When using the batch deletion tool, if the script attempts to delete an undeletable item, the script will die with the error: Label not found for "next BIBLIONUMBER" at /usr/share/koha/intranet/cgi-bin/tools/batch_delete_records.pl line 172.
Created attachment 44146 [details] [review] Bug 15079 - Batch Delete Records Error When using the batch deletion tool, if the script attempts to delete an undeletable item, the script will die with the error: Label not found for "next BIBLIONUMBER" at /usr/share/koha/intranet/cgi-bin/tools/batch_delete_records.pl line 172. Test Plan: 1) Attempt to batch delete a record with an item that cannot be deleted 2) Note error 3) Apply this patch 4) Repeat step 1 5) Note the error no longer occurs
Hi Kyle Another kind of error occur when you only enter one record with an item checked out. The record is highlighted but let delete it with message " All records have been deleted successfully! ", but when you go to see the record, the record still there. I think if only one record exist with an item that cannot deleted, the module must prevent to perform the action in some way. Regards
Hi Kyle I cannot reproduce the error. Is this in master? I'm testing with a fresh installation with only three records (one ítem per record and just one with item that cannot be deleted), but works well for me. Regards
It may be that I'm test plan is incomplete. I spotted the error after a library reported the issue. The bad label clearly exists in master, but the problem records had already been removed so I was unable to reproduce the issue.
Looks like the issue is related to deleteditems having the same itemnumber is an item that is going to be deleted: http://screencast.com/t/jTd5b2DcB3A After clearing out duplicate itemnumber from deleteditems: http://screencast.com/t/PJxpEkf1DP
(In reply to Kyle M Hall from comment #5) > Looks like the issue is related to deleteditems having the same itemnumber > is an item that is going to be deleted: > > http://screencast.com/t/jTd5b2DcB3A > > After clearing out duplicate itemnumber from deleteditems: > > http://screencast.com/t/PJxpEkf1DP How itemnumber is corrupted in the table? I mean it is a unique Id even though if you execute something like this UPDATE items SET itemnumber='1' WHERE itemnumber='2'; ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY' MYSQL doesn't let to do this kind of operations.
Created attachment 44303 [details] [review] [SIGNED-OFF]Bug 15079 - Batch Delete Records Error When using the batch deletion tool, if the script attempts to delete an undeletable item, the script will die with the error: Label not found for "next BIBLIONUMBER" at /usr/share/koha/intranet/cgi-bin/tools/batch_delete_records.pl line 172. Test Plan: 1) Attempt to batch delete a record with an item that cannot be deleted 2) Note error 3) Apply this patch 4) Repeat step 1 5) Note the error no longer occurs Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised. Follow comment 5 to reproduce the issue
Created attachment 44831 [details] [review] Bug 15079 - Batch Delete Records Error When using the batch deletion tool, if the script attempts to delete an undeletable item, the script will die with the error: Label not found for "next BIBLIONUMBER" at /usr/share/koha/intranet/cgi-bin/tools/batch_delete_records.pl line 172. Test Plan: 1) Attempt to batch delete a record with an item that cannot be deleted 2) Note error 3) Apply this patch 4) Repeat step 1 5) Note the error no longer occurs Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised. Follow comment 5 to reproduce the issue Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> I have not tested this patch, but looking at the code it is obviously a mistake. If an error occured, we rollback and skip this record.
Patch pushed to master. Thanks Kyle!
This patch has been pushed to 3.20.x, will be in 3.20.6.
Pushed to 3.18.13, and released.