Description
Tomás Cohen Arazi (tcohen)
2025-08-19 13:55:36 UTC
Created attachment 185541 [details] [review] Bug 40671: Refactor Koha::Hold->revert_waiting into revert_found This patch refactors the revert_waiting method to handle all found statuses instead of just waiting holds, making it more versatile and consistent. Changes: * Renamed method from revert_waiting() to revert_found() * Expanded functionality to handle all found statuses (W, T, P) * Updated exception logic to check is_found instead of is_waiting * Changed exception message from hold_not_waiting to hold_not_found * Added comprehensive tests for all found statuses * Updated POD documentation to reflect new behavior The method now reverts any hold with a found status back to a regular hold with priority 1, regardless of whether it was waiting, in transit, or in processing. To test: 1. Apply the patches 2. Run tests: $ ktd --shell k$ cd /kohadevbox/koha k$ prove t/db_dependent/Koha/Hold.t => SUCCESS: All tests pass including new subtests for T and P statuses 3. Verify all hold test suites pass: k$ prove t/db_dependent/Koha/Hold*.t => SUCCESS: All hold-related tests pass 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 185542 [details] [review] 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> Created attachment 185562 [details] [review] Bug 40671: Refactor Koha::Hold->revert_waiting into revert_found This patch refactors the revert_waiting method to handle all found statuses instead of just waiting holds, making it more versatile and consistent. Changes: * Renamed method from revert_waiting() to revert_found() * Expanded functionality to handle all found statuses (W, T, P) * Updated exception logic to check is_found instead of is_waiting * Changed exception message from hold_not_waiting to hold_not_found * Added comprehensive tests for all found statuses * Updated POD documentation to reflect new behavior The method now reverts any hold with a found status back to a regular hold with priority 1, regardless of whether it was waiting, in transit, or in processing. To test: 1. Apply the patches 2. Run tests: $ ktd --shell k$ cd /kohadevbox/koha k$ prove t/db_dependent/Koha/Hold.t => SUCCESS: All tests pass including new subtests for T and P statuses 3. Verify all hold test suites pass: k$ prove t/db_dependent/Koha/Hold*.t => SUCCESS: All hold-related tests pass 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Created attachment 185563 [details] [review] 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> Looking here * Proving /usr/share/koha/t/db_dependent/SIP/Transaction.t FAIL # Failed test 'The fine is displayed on checkin when show_outstanding_amount is enabled' # at /usr/share/koha/t/db_dependent/SIP/Transaction.t line 706. # got: 'You owe 12.00yqsA for this item.' # expected: 'You owe $12.00 for this item.' # Looks like you failed 1 test of 2. Will fix that one here now. Stumbled over it somewhere else recently too.. Created attachment 185883 [details] [review] Bug 40671: Refactor Koha::Hold->revert_waiting into revert_found This patch refactors the revert_waiting method to handle all found statuses instead of just waiting holds, making it more versatile and consistent. Changes: * Renamed method from revert_waiting() to revert_found() * Expanded functionality to handle all found statuses (W, T, P) * Updated exception logic to check is_found instead of is_waiting * Changed exception message from hold_not_waiting to hold_not_found * Added comprehensive tests for all found statuses * Updated POD documentation to reflect new behavior The method now reverts any hold with a found status back to a regular hold with priority 1, regardless of whether it was waiting, in transit, or in processing. To test: 1. Apply the patches 2. Run tests: $ ktd --shell k$ cd /kohadevbox/koha k$ prove t/db_dependent/Koha/Hold.t => SUCCESS: All tests pass including new subtests for T and P statuses 3. Verify all hold test suites pass: k$ prove t/db_dependent/Koha/Hold*.t => SUCCESS: All hold-related tests pass 4. Sign off :-D 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> Created attachment 185884 [details] [review] 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> Created attachment 185885 [details] [review] Bug 40671: (QA follow-up) Fix hardcoded currency symbol It could be before or after the amount. Assuming that it does not contain digits itself ;) Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Nice work everyone! Pushed to main for 25.11 Nice work everyone! Pushed to 25.05.x Depends on Bug 40058 not in 24.11.x |