Bugzilla – Attachment 135748 Details for
Bug 30909
Regression, Permanent shelving location is always updated when editing location VIA ADDITEM.PL if both are mapped to MARC fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30909: Retain permanent_location if mapped
Bug-30909-Retain-permanentlocation-if-mapped.patch (text/plain), 1.83 KB, created by
Jonathan Druart
on 2022-06-07 09:29:24 UTC
(
hide
)
Description:
Bug 30909: Retain permanent_location if mapped
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-06-07 09:29:24 UTC
Size:
1.83 KB
patch
obsolete
>From 65ab9c790265f7cc98e3244283e657212bf2bb53 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 7 Jun 2022 11:27:04 +0200 >Subject: [PATCH] Bug 30909: Retain permanent_location if mapped > >If items.permanent_location is mapped to a MARC subfields we must retain >the value, not using items.location > >Test plan: >1 - Map permanent_location to a marc field >2 - Expose that field in the item editor >3 - Change the location of the item and retain the permanent location on saving >4 - note that permanent location has not changed > >Test the different other situation, when adding and editing: Empty the field, change only location, change only permanent_location, etc. >--- > cataloguing/additem.pl | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index d1db1d15f92..54a3d2e6a12 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -177,8 +177,11 @@ if ($op eq "additem") { > my @v = grep { $_ ne "" } > uniq $input->multi_param( "items." . $c ); > >- next if !@v >- && $c ne 'permanent_location'; # See 27837 >+ next unless @v; >+ >+ if ( $c eq 'permanent_location' ) { # See 27837 >+ $item->make_column_dirty('permanent_location'); >+ } > > $item->$c(join ' | ', @v); > } >@@ -444,6 +447,10 @@ if ($op eq "additem") { > my @v = map { ( defined $_ && $_ eq '' ) ? undef : $_ } $input->multi_param( "items." . $c ); > next unless @v; > >+ if ( $c eq 'permanent_location' ) { # See 27837 >+ $item->make_column_dirty('permanent_location'); >+ } >+ > if ( scalar(@v) == 1 && not defined $v[0] ) { > delete $new_values->{$c}; > } else { >-- >2.25.1
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 30909
:
135748
|
137873
|
137884