To re-create: 1) Create a text file containing duplicate barcodes Here's a quick way to do that, substitute INSTANCE for the instance name of your test server: sudo koha-mysql INSTANCE <<< "select barcode from items where barcode is not null limit 3" | sed '1d;p' > /tmp/dup_barcodes.txt 2) Go to Home › Tools › Batch item deletion 3) Click 'Choose File', select the file you created in step 1. 4) Click 'Continue' 5) Note that duplicate items appear in the list of items to batch delete 6) Check 'Delete records if no items remain' 7) This will trigger a software error Here is the output from the intranet error log: [Thu Mar 22 08:49:35.030497 2018] [cgi:error] [pid 26116] [client x.x.x.x:y] AH01215: [Thu Mar 22 08:49:35 2018] batchMod.pl: CCL parsing error (10014) Search word expected ZOOM for query: hi= at /usr/share/koha/lib/C4/Search.pm line 275., referer: https://intranet.bywatersolutions.com/cgi-bin/koha/tools/batchMod.pl [Thu Mar 22 08:49:35.039872 2018] [cgi:error] [pid 26116] [client x.x.x.x:y] AH01215: [Thu Mar 22 08:49:35 2018] batchMod.pl: DBIx::Class::Storage::DBI::select_single(): Query returned more than one row. SQL that returns multiple rows is DEPRECATED for ->find and ->single at /usr/share/koha/lib/Koha/Objects.pm line 92, referer: https://intranet.bywatersolutions.com/cgibin/koha/tools/batchMod.pl [Thu Mar 22 08:49:35.040735 2018] [cgi:error] [pid 26116] [client x.x.x.x:y] AH01215: [Thu Mar 22 08:49:35 2018] batchMod.pl: Can't call method "items" on an undefined value at /usr/share/koha/intranet/cgi-bin/tools/batchMod.pl line 187., referer: https://intranet.bywatersolutions.com/cgi-bin/koha/tools/batchMod.pl Note that entering the barcodes via the 'scan items one by one' text box removes duplicates in the list, so this only causes problems when uploading a file. It doesn't matter whether you choose duplicate barcodes or duplicate item numbers, both trigger the some error.
Created attachment 73285 [details] [review] Bug 20462: Ensure batch item deletion will not delete the same item twice This has been done on bug 9509 when barcodes are scaned, but not when using a text file. Test plan (stolen from Barton on the bug report): 1) Create a text file containing duplicate barcodes Here's a quick way to do that, substitute INSTANCE for the instance name of your test server: sudo koha-mysql INSTANCE <<< "select barcode from items where barcode is not null limit 3" | sed '1d;p' > /tmp/dup_barcodes.txt 2) Go to Home › Tools › Batch item deletion 3) Click 'Choose File', select the file you created in step 1. 4) Click 'Continue' 5) Note that duplicate items appear in the list of items to batch delete 6) Check 'Delete records if no items remain' 7) This will trigger a software error Note that entering the barcodes via the 'scan items one by one' text box removes duplicates in the list, so this only causes problems when uploading a file.
Created attachment 73297 [details] [review] Bug 20462: Ensure batch item deletion will not delete the same item twice This has been done on bug 9509 when barcodes are scaned, but not when using a text file. Test plan (stolen from Barton on the bug report): 1) Create a text file containing duplicate barcodes Here's a quick way to do that, substitute INSTANCE for the instance name of your test server: sudo koha-mysql INSTANCE <<< "select barcode from items where barcode is not null limit 3" | sed '1d;p' > /tmp/dup_barcodes.txt 2) Go to Home › Tools › Batch item deletion 3) Click 'Choose File', select the file you created in step 1. 4) Click 'Continue' 5) Note that duplicate items appear in the list of items to batch delete 6) Check 'Delete records if no items remain' 7) This will trigger a software error Note that entering the barcodes via the 'scan items one by one' text box removes duplicates in the list, so this only causes problems when uploading a file. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 73411 [details] [review] Bug 20462: Ensure batch item deletion will not delete the same item twice This has been done on bug 9509 when barcodes are scaned, but not when using a text file. Test plan (stolen from Barton on the bug report): 1) Create a text file containing duplicate barcodes Here's a quick way to do that, substitute INSTANCE for the instance name of your test server: sudo koha-mysql INSTANCE <<< "select barcode from items where barcode is not null limit 3" | sed '1d;p' > /tmp/dup_barcodes.txt 2) Go to Home › Tools › Batch item deletion 3) Click 'Choose File', select the file you created in step 1. 4) Click 'Continue' 5) Note that duplicate items appear in the list of items to batch delete 6) Check 'Delete records if no items remain' 7) This will trigger a software error Note that entering the barcodes via the 'scan items one by one' text box removes duplicates in the list, so this only causes problems when uploading a file. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Pushed to master for 18.05, thanks to everybody involved!
Pushed to stable for 17.11.06 Awesome work all!
Pushed to 17.05.x for v17.05.12