From 275c87a851184fc8e3eca8a5c9f07c8f75b51744 Mon Sep 17 00:00:00 2001 From: Slava Shishkin Date: Wed, 26 Jun 2024 17:02:17 +0300 Subject: [PATCH] Bug 37199: Incorrect "waiting holds" notification for staff - Modified `circ/circulation.pl` to ensure the `waiting_holds` search results are correctly processed using `as_list`. Previously, the search results were passed as an object, which always evaluated to true. By converting the search results to a list, we ensure proper handling and checking of waiting holds. Test Plan: 1. Apply the patch. 2. Set the system preference "WaitingNotifyAtCheckout" to "Notify". 3. Place a hold on one of the available items for a patron (A). 4. Check out another available item from the same bibliographic record to a patron (B). 5. Verify that staff do not receive the incorrect notification when checking out items to patron (B). 6. Ensure the functionality works as expected when checking out items to patron (A). --- circ/circulation.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index d1c2b3b0cfb..7fef79e6d5d 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -670,7 +670,7 @@ if ( $patron ) { $template->param( patron_messages => $patron_messages ); if ( C4::Context->preference("WaitingNotifyAtCheckout") ) { - my $waiting_holds = $patron->holds->search( { found => 'W', branchcode => $branch } ); + my $waiting_holds = $patron->holds->search( { found => 'W', branchcode => $branch } )->as_list; $template->param( waiting_holds => $waiting_holds ); } } -- 2.45.2