From e5d2db78484a7eb44639dbda2b97b578d18861c9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 3 Jan 2024 19:46:34 +0000 Subject: [PATCH] Bug 35692: Do not update not for loan status if ONLYMESSAGE is provided To test: 1 - Set UpdateNotForLoanStatusOnCheckin to: _ALL_: -1: ONLYMESSAGE 2 - Set an item in the catalog as -1/Ordered 3 - Check the item in 4 - Confirm you see the message 5 - View the record details 6 - Item is now for loan 7 - Check item in again, no message 8 - Apply patch, restart all 9 - Set item as not for loan -1/Ordered 10 - Check item in, you see the message 11 - Check it in again, still see message 12 - Check the detail page, item still marked as ordered Signed-off-by: David Nind --- C4/Circulation.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 562cad7267..3943ca89ac 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 }); + $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.30.2