Bugzilla – Attachment 185542 Details for
Bug 40671
Expand Koha::Hold->revert_waiting to handle all found statuses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40671: Update method calls from revert_waiting to revert_found
Bug-40671-Update-method-calls-from-revertwaiting-t.patch (text/plain), 5.19 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-08-19 14:10:02 UTC
(
hide
)
Description:
Bug 40671: Update method calls from revert_waiting to revert_found
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-08-19 14:10:02 UTC
Size:
5.19 KB
patch
obsolete
>From f1e81bb3454d9e3d27b55276b7bf4ff2ddfa48af Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >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 <tomascohen@theke.io> >--- > 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 217eb0f5072..51438ac9b6d 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 87a645a3e3b..6c23f935b46 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 64b2809f205..a553070e4b3 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 888f1b9d5d9..a6267393fdc 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 1a62606326d..1e949f0389f 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 b7b1d26dc41..70f9aeeac07 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 293ca360b19..e77202c8b60 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.51.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40671
:
185541
|
185542
|
185562
|
185563