Bug 20462: Ensure batch item deletion will not delete the same item twice
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 26 Mar 2018 15:22:15 +0000 (12:22 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 2 Apr 2018 21:07:44 +0000 (18:07 -0300)
commit83b364ec56ae94a077542691f790d6153d90c4d1
treeb45834f316604238ff761292f9d9605a6a3763fe
parent391bc7623c25c46111719e3988f110e2cc2174a9
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>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
tools/batchMod.pl