From fc10131cec8f09636c66a77000bd1c803e6b9b45 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Fri, 18 Aug 2017 12:20:40 +0200 Subject: [PATCH] Bug 15752: QA followup - search for patrons only if param barcode is defined Signed-off-by: Alex Buckley Signed-off-by: Kyle M Hall --- circ/circulation.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index ff4950a..73ca23e 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -82,14 +82,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.10.2