Cannot add new author and new topic in one new song

Bug #607034 reported by Jon Tibble
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Fix Released
Medium
Unassigned

Bug Description

When adding a song (editing seems to be okay) you cannot add both a new author and a new topic.
To replicate:
* Click New Song and fill in the first tab then move to the second
* Type in new author and click add author button
* Confirm you wish to add the author and it is added
* Type in a new topic and click add topic button and you should get a stack trace in the terminal

D:\Projects\OpenLP\openlp\trunk>python openlp.pyw
Traceback (most recent call last):
  File "D:\Projects\OpenLP\openlp\trunk\openlp\plugins\songs\forms\editsongform.py", line 345, in onTopicAddButtonClicked
    self.songmanager.save_object(topic)
  File "D:\Projects\OpenLP\openlp\trunk\openlp\core\lib\db.py", line 147, in save_object
    self.session.commit()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\scoping.py", line 123, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 673, in commit
    self.transaction.commit()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 378, in commit
    self._prepare_impl()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 362, in _prepare_impl
    self.session.flush()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 1354, in flush
    self._flush(objects)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 1432, in _flush
    flush_context.execute()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\unitofwork.py", line 257, in execute
    UOWExecutor().execute(self, tasks)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\unitofwork.py", line 720, in execute
    self.execute_save_steps(trans, task)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\unitofwork.py", line 735, in execute_save_steps
    self.save_objects(trans, task)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\unitofwork.py", line 726, in save_objects
    task.mapper._save_obj(task.polymorphic_tosave_objects, trans)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\mapper.py", line 1387, in _save_obj
    c = connection.execute(statement.values(value_params), params)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\engine\base.py", line 824, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\engine\base.py", line 874, in _execute_clauseelement
    return self.__execute_context(context)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\engine\base.py", line 896, in __execute_context
    self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\engine\base.py", line 950, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor, context)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\engine\base.py", line 931, in _handle_dbapi_exception
    raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
sqlalchemy.exc.IntegrityError: (IntegrityError) songs.title may not be NULL u'INSERT INTO songs (song_book_id, title, lyrics, verse_order, copyright, comments, ccli_number, song_number, them
e_name, search_title, search_lyrics) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' [0, None, None, None, None, None, None, None, None, None, None]

* If you click the add topic button again it will succeed with the following trace, this time, in the log file

2010-07-19 01:31:50,385 openlp.core.lib.db ERROR Object save failed
Traceback (most recent call last):
  File "D:\Projects\OpenLP\openlp\trunk\openlp\core\lib\db.py", line 147, in save_object
    self.session.commit()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\scoping.py", line 123, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 673, in commit
    self.transaction.commit()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 378, in commit
    self._prepare_impl()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 351, in _prepare_impl
    self._assert_is_active()
  File "C:\lang\Python26\lib\site-packages\sqlalchemy-0.5.5-py2.6.egg\sqlalchemy\orm\session.py", line 247, in _assert_is_active
    "The transaction is inactive due to a rollback in a "
InvalidRequestError: The transaction is inactive due to a rollback in a subtransaction. Issue rollback() to cancel the transaction.

Jon Tibble (meths)
Changed in openlp:
importance: Undecided → Medium
milestone: none → 1.9.3
status: New → Fix Committed
Revision history for this message
Jon Tibble (meths) wrote :

Released in trunk revision 955

Changed in openlp:
status: Fix Committed → Fix Released
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.