Bug 15752: (QA follow-up) Remove unecessary redirect
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Dec 2017 18:14:22 +0000 (15:14 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 20:38:58 +0000 (17:38 -0300)
We are on circulation.pl, no need to redirect.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
circ/circulation.pl

index cd7b550..3622aa6 100755 (executable)
@@ -83,12 +83,18 @@ if (!C4::Context->userenv){
 
 my $barcodes = [];
 my $barcode =  $query->param('barcode');
+my $findborrower;
+my $autoswitched;
 
 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&amp;autoswitched=1");
+        $findborrower = $barcode;
+        undef $barcode;
+        $autoswitched = 1;
     }
 }
+$findborrower ||= $query->param('findborrower') || q{};
+$findborrower =~ s|,| |g;
 
 # Barcode given by user could be '0'
 if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) {
@@ -154,9 +160,6 @@ for (@failedreturns) { $return_failed{$_} = 1; }
 
 my $searchtype = $query->param('searchtype') || q{contain};
 
-my $findborrower = $query->param('findborrower') || q{};
-$findborrower =~ s|,| |g;
-
 my $branch = C4::Context->userenv->{'branch'};
 
 if (C4::Context->preference("DisplayClearScreenButton")) {
@@ -669,7 +672,7 @@ $template->param(
     has_modifications         => $has_modifications,
     override_high_holds       => $override_high_holds,
     nopermission              => scalar $query->param('nopermission'),
-    autoswitched              => $query->param("autoswitched"),
+    autoswitched              => $autoswitched,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;