From b8b31f8ba47f9b94bc797a0adc3045814710a614 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 Signed-off-by: Joy Nelson (cherry picked from commit d14e25b57ed68637517da323d28108d5ea5b247b) --- 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 42416b3a63..0819e4787f 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') && $action eq 'lookup') ? $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 ) ) } ); my $title = ($item) ? $item->biblio->title : undef; -- 2.39.5