From 71ce0d96c9d72571e45c568acb7aab321a42009b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 21 Aug 2015 09:23:53 +0200 Subject: [PATCH] Bug 9809: [QA Follow-up] Remove warnings from Hold.pm Resolves two warnings on a uninitialized found column: holds: Use of uninitialized value in string eq at /home/koha/testclone/Koha/Hold.pm line 53., referer: http://test.rijkskoha.nl:28080/cgi-bin/koha/circ/circulation.pl?borrowernumber=152 holds: Use of uninitialized value in string eq at /home/koha/testclone/Koha/Hold.pm line 74., referer: http://test.rijkskoha.nl:28080/cgi-bin/koha/circ/circulation.pl?borrowernumber=152 Test plan: Run t/db_dependent/Hold.t. Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- Koha/Hold.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index b874f13dda..ad84af3b99 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -50,7 +50,8 @@ Returns undef if the hold is not waiting ( found = 'W' ). sub waiting_expires_on { my ($self) = @_; - return unless $self->found() eq 'W'; + my $found = $self->found; + return unless $found && $found eq 'W'; my $ReservesMaxPickUpDelay = C4::Context->preference('ReservesMaxPickUpDelay'); return unless $ReservesMaxPickUpDelay; @@ -71,7 +72,8 @@ Returns true if hold is a waiting hold sub is_waiting { my ($self) = @_; - return $self->found() eq 'W'; + my $found = $self->found; + return $found && $found eq 'W'; } =head3 biblio -- 2.39.5