From 26e7d0c9b392286c784a90fa75024ee1232f2e1e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 4 Jan 2024 19:03:11 +0000 Subject: [PATCH] Bug 35293: (follow-up) Handle all rules as well Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- C4/Circulation.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 639b558c8a..29abc95ac7 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2228,7 +2228,9 @@ sub AddReturn { foreach my $notloan_rule_key (keys %{ $rules->{$item->itype}} ) { if ( $item->notforloan eq $notloan_rule_key ) { $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$item->itype}->{$notloan_rule_key} }; - $item->notforloan($rules->{$item->itype}->{$notloan_rule_key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }) unless $rules->{$item->itype}->{$notloan_rule_key} eq 'ONLYMESSAGE'; + $item->notforloan( $rules->{ $item->itype }->{$notloan_rule_key} ) + ->store( { log_action => 0, skip_record_index => 1, skip_holds_queue => 1 } ) + unless $rules->{ $item->itype }->{$notloan_rule_key} eq 'ONLYMESSAGE'; last; } } @@ -2236,7 +2238,9 @@ sub AddReturn { foreach my $notloan_rule_key (keys %{ $rules->{'_ALL_'}} ) { if ( $item->notforloan eq $notloan_rule_key ) { $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{'_ALL_'}->{$notloan_rule_key} }; - $item->notforloan($rules->{'_ALL_'}->{$notloan_rule_key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }); + $item->notforloan( $rules->{'_ALL_'}->{$notloan_rule_key} ) + ->store( { log_action => 0, skip_record_index => 1, skip_holds_queue => 1 } ) + unless $rules->{ '_ALL_' }->{$notloan_rule_key} eq 'ONLYMESSAGE'; last; } } -- 2.39.2