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 <tomascohen@theke.io>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2025-08-19 13:58:56 +00:00 committed by Lucas Gass
parent bd9fa395e5
commit 4ad2c94690
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
7 changed files with 9 additions and 9 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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,

View File

@ -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(

View File

@ -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 );

View File

@ -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;

View File

@ -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' );