Bug 13894: Fix if the search returns only 1 result
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 30 Mar 2015 10:05:57 +0000 (12:05 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 30 Mar 2015 15:56:57 +0000 (12:56 -0300)
In the case where only 1 result is returned by the search, the
borrowernumber should be passed correctly.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
reserve/request.pl

index 0576020..f72f32e 100644 (file)
@@ -487,7 +487,7 @@ No patron matched <span class="ex">[% message %]</span>
 [% END %]
 
 
-[% IF ( selectborrower ) %]
+[% IF ( borrowers ) %]
 [% INCLUDE 'patron-toolbar.inc' %]
 
 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
index 7d9c5e6..f56079f 100755 (executable)
@@ -116,7 +116,7 @@ if ($findborrower) {
         );
         my $borrowers = $results->{patrons};
         if ( scalar @$borrowers == 1 ) {
-            $borrowernumber_hold = $borrower->[0]->{borrowernumber};
+            $borrowernumber_hold = $borrowers->[0]->{borrowernumber};
         } elsif ( @$borrowers ) {
             $template->param( borrowers => $borrowers );
         } else {