← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/fixes into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #598393 in OpenLP: "After adding a new image to a selected (image) item in the service manager it is not selected anymore"
  https://bugs.launchpad.net/openlp/+bug/598393
  Bug #719102 in OpenLP: "editing author after editing song causes traceback"
  https://bugs.launchpad.net/openlp/+bug/719102
  Bug #730979 in OpenLP: "Song export crashes"
  https://bugs.launchpad.net/openlp/+bug/730979
  Bug #747206 in OpenLP: "Missing dictionary for spell check prevents program start"
  https://bugs.launchpad.net/openlp/+bug/747206

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/58906

Hello,

- fixed a bug where authors/books/topics of a song might get lost when merging authors/books/topics

In some cases the get_object_filtered method returned the old_<foo> object. Example: The old_author object was deleted, but we also appended the existing_author (which is the same object as old_author) to a song's authors.
-- 
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/58906
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
--- openlp/plugins/songs/forms/songmaintenanceform.py	2011-04-15 21:43:59 +0000
+++ openlp/plugins/songs/forms/songmaintenanceform.py	2011-04-24 15:41:26 +0000
@@ -386,7 +386,8 @@
         existing_author = self.manager.get_object_filtered(Author,
             and_(Author.first_name == old_author.first_name,
                 Author.last_name == old_author.last_name,
-                Author.display_name == old_author.display_name))
+                Author.display_name == old_author.display_name,
+                Author.id != old_author.id))
         # Find the songs, which have the old_author as author.
         songs = self.manager.get_all_objects(Song,
             Song.authors.contains(old_author))
@@ -408,7 +409,7 @@
         """
         # Find the duplicate.
         existing_topic = self.manager.get_object_filtered(Topic,
-            Topic.name == old_topic.name)
+            and_(Topic.name == old_topic.name, Topic.id != old_topic.id))
         # Find the songs, which have the old_topic as topic.
         songs = self.manager.get_all_objects(Song,
             Song.topics.contains(old_topic))
@@ -431,7 +432,8 @@
         # Find the duplicate.
         existing_book = self.manager.get_object_filtered(Book,
             and_(Book.name == old_book.name,
-                Book.publisher == old_book.publisher))
+                Book.publisher == old_book.publisher,
+                Book.id != old_book.id))
         # Find the songs, which have the old_book as book.
         songs = self.manager.get_all_objects(Song,
             Song.song_book_id == old_book.id)
@@ -503,4 +505,5 @@
             editButton.setEnabled(False)
         else:
             deleteButton.setEnabled(True)
-            editButton.setEnabled(True)
\ No newline at end of file
+            editButton.setEnabled(True)
+


Follow ups