Bugzilla – Attachment 151729 Details for
Bug 32478
Remove Koha::Config::SysPref->find since bypasses cache
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32478: (follow-up) Tidy code
Bug-32478-follow-up-Tidy-code.patch (text/plain), 4.61 KB, created by
Marcel de Rooy
on 2023-05-26 10:07:27 UTC
(
hide
)
Description:
Bug 32478: (follow-up) Tidy code
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-26 10:07:27 UTC
Size:
4.61 KB
patch
obsolete
>From 595d90461e7562ee848cbfbac94a6405cd6a2502 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 4 May 2023 18:39:50 +0000 >Subject: [PATCH] Bug 32478: (follow-up) Tidy code >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Circulation.pm | 65 +++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 52 insertions(+), 13 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 3965249486..8225b366bb 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2139,24 +2139,63 @@ sub AddReturn { > > my $update_loc_rules = C4::Context->yaml_preference('UpdateItemLocationOnCheckin'); > if ($update_loc_rules) { >- if (defined $update_loc_rules->{_ALL_}) { >- if ($update_loc_rules->{_ALL_} eq '_PERM_') { $update_loc_rules->{_ALL_} = $item->permanent_location; } >- if ($update_loc_rules->{_ALL_} eq '_BLANK_') { $update_loc_rules->{_ALL_} = ''; } >+ if ( defined $update_loc_rules->{_ALL_} ) { >+ if ( $update_loc_rules->{_ALL_} eq '_PERM_' ) { >+ $update_loc_rules->{_ALL_} = $item->permanent_location; >+ } >+ if ( $update_loc_rules->{_ALL_} eq '_BLANK_' ) { >+ $update_loc_rules->{_ALL_} = ''; >+ } > if ( >- ( defined $item->location && $item->location ne $update_loc_rules->{_ALL_}) || >- (!defined $item->location && $update_loc_rules->{_ALL_} ne "") >- ) { >- $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{_ALL_} }; >- $item->location($update_loc_rules->{_ALL_})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1}); >+ ( >+ defined $item->location >+ && $item->location ne $update_loc_rules->{_ALL_} >+ ) >+ || ( !defined $item->location >+ && $update_loc_rules->{_ALL_} ne "" ) >+ ) >+ { >+ $messages->{'ItemLocationUpdated'} = >+ { from => $item->location, to => $update_loc_rules->{_ALL_} }; >+ $item->location( $update_loc_rules->{_ALL_} )->store( >+ { >+ log_action => 0, >+ skip_record_index => 1, >+ skip_holds_queue => 1 >+ } >+ ); > } > } > else { > foreach my $key ( keys %$update_loc_rules ) { >- if ( $update_loc_rules->{$key} eq '_PERM_' ) { $update_loc_rules->{$key} = $item->permanent_location; } >- elsif ( $update_loc_rules->{$key} eq '_BLANK_') { $update_loc_rules->{$key} = '' ;} >- if ( (defined $item->location && $item->location eq $key && $item->location ne $update_loc_rules->{$key}) || ($key eq '_BLANK_' && ( !defined $item->location || $item->location eq '' ) && $update_loc_rules->{$key} ne '') ) { >- $messages->{'ItemLocationUpdated'} = { from => $item->location, to => $update_loc_rules->{$key} }; >- $item->location($update_loc_rules->{$key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1}); >+ if ( $update_loc_rules->{$key} eq '_PERM_' ) { >+ $update_loc_rules->{$key} = $item->permanent_location; >+ } >+ elsif ( $update_loc_rules->{$key} eq '_BLANK_' ) { >+ $update_loc_rules->{$key} = ''; >+ } >+ if ( >+ ( >+ defined $item->location >+ && $item->location eq $key >+ && $item->location ne $update_loc_rules->{$key} >+ ) >+ || ( $key eq '_BLANK_' >+ && ( !defined $item->location || $item->location eq '' ) >+ && $update_loc_rules->{$key} ne '' ) >+ ) >+ { >+ $messages->{'ItemLocationUpdated'} = { >+ from => $item->location, >+ to => $update_loc_rules->{$key} >+ }; >+ $item->location( $update_loc_rules->{$key} )->store( >+ { >+ log_action => 0, >+ skip_record_index => 1, >+ skip_holds_queue => 1 >+ } >+ ); > last; > } > } >-- >2.30.2
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 32478
:
144633
|
150685
|
150687
|
150688
|
150689
|
150690
|
151136
|
151726
|
151727
|
151728
| 151729 |
151730
|
151731
|
151732