From: Aleisha <[email protected]>

This patch sets $reservedfor to an empty string.

Test plan
=========

1/ in a terminal, run `tail -f ` on your instance's opac-error.log
2/ go to the opac and search from an item that exists on the Koha
   instance.
3/ Select the title (if more than one title is returned) and click on
   'Place hold' link to go to opac-reserve.pl
4/ notice the warning - "opac-reserve.pl: Use of uninitialized value
   $reservedfor" appear in the `tail`ed opac-error.log
5/ apply the patch
6/ reload the page (opac-reserve.pl)
7/ page works but the warning in step #4 is no longer thrown up
8/ run qa test (i.e. koha-qa.pl -c 1 -v 2), there should be no error

Remarks: The QA test failed - "forbidden pattern: tab char (line 470)".

         Marking this as 'FAILED QA'
---
 opac/opac-reserve.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl
index 5ab4c34..51402b8 100755
--- a/opac/opac-reserve.pl
+++ b/opac/opac-reserve.pl
@@ -466,7 +466,8 @@ foreach my $biblioNum (@biblionumbers) {
         my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
 
         # the item could be reserved for this borrower vi a host record, flag 
this
-        if ($reservedfor eq $borrowernumber){
+        $reservedfor //= '';
+       if ($reservedfor eq $borrowernumber){
             $itemLoopIter->{already_reserved} = 1;
         }
 
-- 
1.9.1

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to