From a15932117cae6341a91cd0f21bdd05fb2a4c0922 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 1 May 2020 17:01:11 +0000 Subject: [PATCH] Bug 25341: Remove whitespace from barcode in add_items.pl TEST PLAN: 1. Go to course reserves and trying adding a course with a barcode that has some leading/trailing whitespace. 2. It doesnt work 3. Apply patch and restart_all 4. Try again with leading/trailing whitespace, it should work. Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- course_reserves/add_items.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/course_reserves/add_items.pl b/course_reserves/add_items.pl index 3e98570f33..33763d8ee9 100755 --- a/course_reserves/add_items.pl +++ b/course_reserves/add_items.pl @@ -42,6 +42,8 @@ my $return = $cgi->param('return') || ''; my $itemnumber = $cgi->param('itemnumber') || ''; my $is_edit = $cgi->param('is_edit') || ''; +$barcode =~ s/^\s*|\s*$//g; #remove leading/trailing whitespace + my $item = Koha::Items->find( { ( $itemnumber ? ( itemnumber => $itemnumber ) : ( barcode => $barcode ) ) } ); $itemnumber = $item->id if $item; -- 2.39.5