From 605382ef65dbacf7aeb547dbd129ae1fc213979e Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 19 Aug 2025 13:58:56 +0000 Subject: [PATCH] Bug 40671: Update method calls from revert_waiting to revert_found This patch updates all existing calls to the renamed method throughout the codebase to maintain compatibility. Changes: * Updated C4::Circulation calls to use revert_found() * Updated C4::Reserves calls to use revert_found() * Updated test files to use revert_found() * Maintained all existing functionality and behavior All existing functionality is preserved - this is purely a method name change to reflect the expanded capability. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Emily Lamancusa --- C4/Circulation.pm | 2 +- C4/Reserves.pm | 2 +- reserve/request.pl | 2 +- t/db_dependent/Hold.t | 4 ++-- t/db_dependent/Koha/Holds.t | 4 ++-- t/db_dependent/Reserves.t | 2 +- t/db_dependent/SIP/Transaction.t | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 217eb0f507..51438ac9b6 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2568,7 +2568,7 @@ sub AddReturn { # if a hold is found and is waiting at another branch, change the priority back to 1 and trigger the hold (this will trigger a transfer and update the hold status properly) if ( $resfound and $resfound eq "Waiting" and $branch ne $resrec->{branchcode} ) { - $hold->revert_waiting(); + $hold->revert_found(); $resfound = 'Reserved'; $resrec = $hold->unblessed; } diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 87a645a3e3..6c23f935b4 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -2085,7 +2085,7 @@ sub MoveReserve { $hold = Koha::Holds->find( $res->{reserve_id} ); if ( $cancelreserve eq 'revert' ) { - $hold->revert_waiting(); + $hold->revert_found(); } elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) { # cancel reserves on this item $hold->cancel; } diff --git a/reserve/request.pl b/reserve/request.pl index 64b2809f20..a553070e4b 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -103,7 +103,7 @@ if ( $op eq 'cud-move' ) { my $hold_itemnumber = $input->param('itemnumber'); if ( $prev_priority == 0 && $next_priority == 1 ) { my $hold = Koha::Holds->find($reserve_id); - $hold->revert_waiting(); + $hold->revert_found(); } else { AlterPriority( $where, $reserve_id, $prev_priority, diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t index 888f1b9d5d..a6267393fd 100755 --- a/t/db_dependent/Hold.t +++ b/t/db_dependent/Hold.t @@ -257,7 +257,7 @@ subtest "store() tests" => sub { $hold->discard_changes; $hold->set_waiting; - $hold->revert_waiting(); + $hold->revert_found(); $hold->discard_changes; $expected_date = dt_from_string( $hold->reservedate )->add( years => 2 )->ymd; @@ -283,7 +283,7 @@ subtest "store() tests" => sub { $hold->discard_changes; $hold->set_waiting; - $hold->revert_waiting(); + $hold->revert_found(); $hold->discard_changes; is( diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t index 1a62606326..1e949f0389 100755 --- a/t/db_dependent/Koha/Holds.t +++ b/t/db_dependent/Koha/Holds.t @@ -992,7 +992,7 @@ subtest 'set_waiting+patron_expiration_date' => sub { is( $hold->expirationdate, $patron_expiration_date ); is( $hold->patron_expiration_date, $patron_expiration_date ); - $hold->revert_waiting(); + $hold->revert_found(); $hold = $hold->get_from_storage; is( $hold->expirationdate, $patron_expiration_date ); @@ -1033,7 +1033,7 @@ subtest 'set_waiting+patron_expiration_date' => sub { is( $hold->expirationdate, $new_expiration_date ); is( $hold->patron_expiration_date, $patron_expiration_date ); - $hold->revert_waiting(); + $hold->revert_found(); $hold = $hold->get_from_storage; is( $hold->expirationdate, $patron_expiration_date ); diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index b7b1d26dc4..70f9aeeac0 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -1105,7 +1105,7 @@ subtest 'MoveReserve additional test' => sub { }; # FIXME: Should be in Circulation.t -subtest 'AddIssue calls $hold->revert_waiting()' => sub { +subtest 'AddIssue calls $hold->revert_found()' => sub { plan tests => 2; diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index 293ca360b1..e77202c8b6 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -1119,7 +1119,7 @@ subtest do_checkout_with_holds => sub { # Test non-attached holds $hold->set_waiting(); - $hold->revert_waiting(); + $hold->revert_found(); t::lib::Mocks::mock_preference( 'AllowItemsOnHoldCheckoutSIP', '0' ); $co_transaction->do_checkout(); is( $patron->checkouts->count, 0, 'Checkout refused due to hold and AllowItemsOnHoldCheckoutSIP' ); -- 2.34.1