https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43469

Emmi Takkinen <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[email protected] |[email protected]
                   |ity.org                     |
             Status|NEW                         |Needs Signoff

--- Comment #1 from Emmi Takkinen <[email protected]> ---
Created attachment 205141
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205141&action=edit
Bug 43469: Rollback deleting biblio if error occurs

In some edge cases, deleting a biblio can fail for example due
error deleting biblios metadata. When this happens biblio is left
both in biblio and deletedbiblio tables, moved to deletedbiblioitems
table and left to biblio_metadata table. This patch adds rollback
to prevent this from happening and changes the way error is displayed
in UI.

To test:
1. Create a biblio record.
2. Find sub _koha_delete_biblio_metadata from Biblio.pm and break
it, e.g. remove one column from SQL query.
3. Attempt to delete biblio.
=> Error "ERROR when DELETING BIBLIO x : Exception raised -
DBI Exception: DBD::mysql::db do failed..." is raised but not as
standard template error as in other error cases.
4. Search your biblio from database.
=> Note that biblio is in both biblio and deletedbiblio table.
=> Note that biblio has been inserted to deletedbiblioitems table
and deleted from biblioitems table.
=> Note that biblios metadata is still in biblio_metadata table but
not in deletedbiblio_metadata table.
5. Apply this patch.
6. Create a new biblio or use previously created one (remember to remove
biblio from deletedbiblio table and insert biblioitems row back).
7. Break code again and attempt to delete biblio.
=> Standard template error is displayed.
=> Detailed error message is displayed in logs.
8. Search your biblio from database.
=> Confirm that biblio is not in deletedbiblio, deleteditems or
deletedbiblio_metadata tables.

Sponsored-by: Koha-Suomi Oy

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to