From d4b83620f0456a2b864926dc85de9b0f5757f30f Mon Sep 17 00:00:00 2001 From: Yvonne Waterman Date: Thu, 17 Jul 2025 23:42:31 +0000 Subject: [PATCH] Bug 31930: Ignore whitespace before and after barcodes Decoded the barcode in add items to collection. Test plan: 1. Go to Tools -> Rotating collections 2. Create a rotating collection 3. Chose Actions -> Manage items 4. Paste a barcode and put some spaces around it, for example " 39999000010053 " 5. Click Submit => Shown an error, no item with matching barcode found, though the barcode is printed without all the whitespace 6. Apply patch 7. Repeat steps 1 - 5, barcode should be accepted Signed-off-by: David Nind Signed-off-by: Lucas Gass (cherry picked from commit 2c730040b1ac327f9642c543b31892fbfd929880) Signed-off-by: Paul Derscheid (cherry picked from commit 80a18103162d9dfdc871c3f9bedfb4fad100d970) Signed-off-by: Fridolin Somers --- rotating_collections/addItems.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rotating_collections/addItems.pl b/rotating_collections/addItems.pl index 1872578095..f3de0d0952 100755 --- a/rotating_collections/addItems.pl +++ b/rotating_collections/addItems.pl @@ -20,6 +20,7 @@ use Modern::Perl; use C4::Output qw( output_html_with_http_headers ); use C4::Auth qw( get_template_and_user ); +use C4::Circulation qw( barcodedecode ); use C4::Context; use C4::RotatingCollections; @@ -43,6 +44,7 @@ if ( defined $op and ## Add the given item to the collection my $colId = $query->param('colId'); my $barcode = $query->param('barcode'); + $barcode = barcodedecode($barcode); my $removeItem = $query->param('removeItem'); my $item = Koha::Items->find({barcode => $barcode}); my $itemnumber = $item ? $item->itemnumber : undef;