From 0e220869f5a3327eee8f9426d648fbcaaa0fd7fa Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 14 Jan 2019 05:41:48 +0000 Subject: [PATCH] Bug 17347: Ignore whitespace before and after on renewing When an item is checked out, Koha ignores whitespace at the beginning and the end of the entered barcode. This makes life easier, if a barcode is C&P from another page. This patch makes the renewal page behave the same. To test: - Checkout an item - Renew the item from the renew tab or renewal page entering the barcode with leading and trailing whitespace - "Barcode not found" - Apply patch - Try again - Barcode should be found now Signed-off-by: Owen Leonard Signed-off-by: Devinim Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- circ/renew.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/circ/renew.pl b/circ/renew.pl index 246c26629f..5304f405ae 100755 --- a/circ/renew.pl +++ b/circ/renew.pl @@ -52,6 +52,7 @@ my $error = q{}; my ( $soonest_renew_date, $latest_auto_renew_date ); if ($barcode) { + $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace $item = $schema->resultset("Item")->single( { barcode => $barcode } ); if ($item) { -- 2.39.5