From 88735fd8fef786ac10d167e1b027fa7ad9c75a9e Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 18 Aug 2017 12:20:40 +0200 Subject: [PATCH] Bug 15752: (follow-up) Search for patrons only if param barcode is defined Signed-off-by: Alex Buckley Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- circ/circulation.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 3a181909a1..3df7b1ebf3 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -81,14 +81,15 @@ if (!C4::Context->userenv){ } } -if (C4::Context->preference("AutoSwitchPatron") ) { - if (Koha::Patrons->search( { cardnumber => $query->param('barcode')} )->count() > 0) { - print $query->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=".$query->param('barcode')); +my $barcodes = []; +my $barcode = $query->param('barcode'); + +if (C4::Context->preference("AutoSwitchPatron") && $barcode) { + if (Koha::Patrons->search( { cardnumber => $barcode} )->count() > 0) { + print $query->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=".$barcode); } } -my $barcodes = []; -my $barcode = $query->param('barcode'); # Barcode given by user could be '0' if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) { $barcodes = [ $barcode ]; -- 2.39.5