From 6c9d468afdb3087d7b42e0ff42e593ce5e6c07fe 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 Content-Type: text/plain; charset=utf-8 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 --- Koha/Hold.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index b874f13..ad84af3 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 -- 1.7.10.4