From 54f7ffb313c44b1036613cf48c08ae9a3b44e132 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Wed, 23 Jul 2014 11:15:57 +0300 Subject: [PATCH] Bug 8474: Holds done by librarians cause silent errors in koha-error_log, placerequest.pl -> $checkitem Squashed this rogue variable initialization Test plan: 1/ Place a hold at a biblio level (on the next available item) 2/ Without this patch you get placerequest.pl: Use of uninitialized value $checkitem in string ne at /home/koha/src/reserve/placerequest.pl line 75. placerequest.pl: Use of uninitialized value $checkitem in string ne at /home/koha/src/reserve/placerequest.pl line 101. Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer Fixed a tab. Signed-off-by: Tomas Cohen Arazi --- reserve/placerequest.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index 7689b54603..1fc243616a 100755 --- a/reserve/placerequest.pl +++ b/reserve/placerequest.pl @@ -72,7 +72,7 @@ my $found; # if we have an item selectionned, and the pickup branch is the same as the holdingbranch # of the document, we force the value $rank and $found . -if ($checkitem ne ''){ +if (defined $checkitem && $checkitem ne ''){ $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns'); my $item = $checkitem; $item = GetItem($item); @@ -98,7 +98,7 @@ if ($type eq 'str8' && $borrower){ } my $const; - if ($checkitem ne ''){ + if (defined $checkitem && $checkitem ne ''){ my $item = GetItem($checkitem); if ($item->{'biblionumber'} ne $biblionumber) { $biblionumber = $item->{'biblionumber'}; -- 2.39.5