Exception when selecting a song with "Author Unknown"

Bug #1401163 reported by Oliver Wieland
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Expired
Medium
Unassigned

Bug Description

OS: Ubuntu 14.10
OpenLP: trunk

I have song database upgraded from V2.0.4 to V2.1.2.
There is an Author called "Author unknown" for songs I do not know the author.
When I select (edit / preview / go live) one of these songs, I get an exception (see below)

I still get the exception on all these songs, even when I change the author for the song in the db directly (table authors_songs).
I also changed the db entry for this author itself (changed the name), but the problem still occurs.

When I assign the author "Author Unknown" to a new song, everything works, no exception.

  File "/home/oli/Programmierung/openlp/openlp/openlp/openlp/core/lib/mediamanageritem.py", line 472, in on_double_clicked
    self.on_preview_click()
  File "/home/oli/Programmierung/openlp/openlp/openlp/openlp/core/lib/mediamanageritem.py", line 494, in on_preview_click
    service_item = self.build_service_item()
  File "/home/oli/Programmierung/openlp/openlp/openlp/openlp/core/lib/mediamanageritem.py", line 627, in build_service_item
    if self.generate_slide_data(service_item, item, xml_version, remote, context):
  File "/home/oli/Programmierung/openlp/openlp/openlp/openlp/plugins/songs/lib/mediaitem.py", line 456, in generate_slide_data
    author_list = self.generate_footer(service_item, song)
  File "/home/oli/Programmierung/openlp/openlp/openlp/openlp/plugins/songs/lib/mediaitem.py", line 488, in generate_footer
    authors_none.append(author_song.author.display_name)
AttributeError: 'NoneType' object has no attribute 'display_name'

Below is an example or one of the songs the exception occurs (csv)

table authors
"id", "first_name", "last_name", "display_name"
"933", "Author", "Unknown", "Author Unknown"

table authors_songs
"author_id", "song_id", "author_type"
"933", "65", ""

table songs
"id", "song_book_id", "title", "alternate_title", "lyrics", "verse_order", "copyright", "comments", "ccli_number", "song_number", "theme_name", "search_title", "search_lyrics", "create_date", "last_modified", "temporary"
"65", "", "Komm, jetzt ist die Zeit, wir beten an.", "", "<?xml version='1.0' encoding='UTF-8'?>\n<song version=""1.0""><lyrics><verse label=""1"" type=""v""><![CDATA[Komm, jetzt ist die Zeit, wir beten an.\nKomm, jetzt ist die Zeit, gib ihm dein Herz.]]></verse><verse label=""2"" type=""v""><![CDATA[Jede Zunge wird dich bekennen als Gott,\njeder wird sich beugen vor dir.]]></verse><verse label=""3"" type=""v""><![CDATA[Doch der größte Schatz bleibt für die besteh'n,\ndie jetzt schon mit dir gehen.]]></verse><verse label=""4"" type=""v""><![CDATA[Come, now is the time to worship.\nCome, now is the time to give your heart.]]></verse><verse label=""5"" type=""v""><![CDATA[Come, just as you are to worship.\nCome, just as you are before your God.]]></verse><verse label=""6"" type=""v""><![CDATA[One day every tongue will confess, You are God,\nOne day every knee will bow.]]></verse><verse label=""7"" type=""v""><![CDATA[Still, the greatest treasure remains for those\nwho gladly choose You now.]]></verse></lyrics></song>", "v1 v2 v3 v4 v5 v6 v7 v1", "", "", "", "", "Blue Burst", "komm jetzt ist die zeit wir beten an @", "komm jetzt ist die zeit wir beten an komm jetzt ist die zeit gib ihm dein herz jede zunge wird dich bekennen als gott jeder wird sich beugen vor dir doch der größte schatz bleibt für die bestehn die jetzt schon mit dir gehen come now is the time to worship come now is the time to give your heart come just as you are to worship come just as you are before your god one day every tongue will confess you are god one day every knee will bow still the greatest treasure remains for those who gladly choose you now ", "2013-05-22 19:13:27", "2013-08-10 08:07:29", "0"

Revision history for this message
Tomas Groth (tomasgroth) wrote :

Would it be possible for us to get a copy of the song db? I can't help thinking that something might have gone wrong during the update, so if you get a copy of the db from before the update to the beta, we'd like a copy of that as well. Drop by in IRC and post a link, or send it to our support mail.

Revision history for this message
Oliver Wieland (oliwee) wrote :

I attached the song database with the issue.

Revision history for this message
Oliver Wieland (oliwee) wrote :

Sorry, forgot the database before the upgrade

Phill (phill-ridout)
Changed in openlp:
importance: Undecided → Medium
Phill (phill-ridout)
Changed in openlp:
status: New → Won't Fix
status: Won't Fix → Incomplete
Revision history for this message
Phill (phill-ridout) wrote :

As discussed on IRC.

The problem is that the author_song table has author_id's in it that do not exist as an id in the author table. This problem exists in the original data in 2.0.4 before it was exported to 2.1.1. The fact that 2.1.1 shows an error just means that OpenLP 2.0.4 was more tolerant.

It could be that there is a bug in OpenLP that is causing these authors to be deleted, but with out further information it will be near impossible to find it.

Revision history for this message
Oliver Wieland (oliwee) wrote :

At the moment the user has no chance to fix the problem without patching the database directly. If 2.0.4 is more tolerant then 2.1.x, then the user should at least have the possibility to fix the problem in the UI.

Two possible soutions:
1. Check the db for inconsistency when upgrading to 2.1.x. Eventually add the not existing authors with an default string ('<Unnamed Author>'). Inform the user about the problems in an upgrade.log

2. Return an empty or default string ('<Unnamed Author>') when accessed to a not existing author.

3. Show a messagebox where the user can add the author, when this issue occures.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenLP because there has been no activity for 60 days.]

Changed in openlp:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.