From 9fa649e345073dc7a3bf0113e617b0257e967b44 Mon Sep 17 00:00:00 2001 From: Wainui Witika-Park Date: Wed, 8 Sep 2021 00:46:45 +0000 Subject: [PATCH] Revert "Merge branch '19.11.xbug28644' into rmaint_19.11.x" This reverts commit 2d8b74f96d161ed89d6b29baab174282574eefc3, reversing changes made to c1e2202dd3acce2441dd221a7a9e2cb448077de0. --- C4/Reserves.pm | 2 +- t/db_dependent/Reserves.t | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index ba6747a963..624bdf0df1 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -523,7 +523,7 @@ sub CanReserveBeCanceledFromOpac { my ($reserve_id, $borrowernumber) = @_; return unless $reserve_id and $borrowernumber; - my $reserve = Koha::Holds->find($reserve_id) or return; + my $reserve = Koha::Holds->find($reserve_id); return 0 unless $reserve->borrowernumber == $borrowernumber; return 0 if ( $reserve->found eq 'W' ) or ( $reserve->found eq 'T' ); diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 1596a8f858..e1f5025bb2 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 64; +use Test::More tests => 63; use Test::MockModule; use Test::Warn; @@ -485,8 +485,6 @@ $cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{$br is($cancancel, 0, 'Reserve in transfer status cant be canceled'); $dbh->do('DELETE FROM reserves', undef, ($bibnum)); -is( CanReserveBeCanceledFromOpac($canres->{resserve_id}, $requesters{$branch_1}), undef, - 'Cannot cancel a deleted hold' ); AddReserve($branch_1, $requesters{$branch_1}, $item_bibnum, $bibitems, 1, undef, $expdate, $notes, 'a title', $checkitem, ''); -- 2.39.5