Bug 17347: Ignore whitespace before and after on renewing
authorKatrin Fischer <katrin.fischer.83@web.de>
Mon, 14 Jan 2019 05:41:48 +0000 (05:41 +0000)
committerroot <root@f1ebe1bec408>
Mon, 11 Feb 2019 18:30:10 +0000 (18:30 +0000)
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 <oleonard@myacpl.org>
Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
circ/renew.pl

index 246c266..5304f40 100755 (executable)
@@ -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) {