Bugzilla – Attachment 123654 Details for
Bug 28832
[21.05] Batch modification always clears permanent_location if it is mapped in frameworks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28832: Don't batch modify fields that we don't update
Bug-28832-Dont-batch-modify-fields-that-we-dont-up.patch (text/plain), 2.32 KB, created by
Nick Clemens (kidclamp)
on 2021-08-09 16:32:03 UTC
(
hide
)
Description:
Bug 28832: Don't batch modify fields that we don't update
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-08-09 16:32:03 UTC
Size:
2.32 KB
patch
obsolete
>From c0487fc4cfe997777029d8147bc230c615e11a73 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 9 Aug 2021 16:28:16 +0000 >Subject: [PATCH] Bug 28832: Don't batch modify fields that we don't update > >In bug 27837 we made sure to always pass through the permanent_location if it was passed in unlike >other fields which are not passed if they have no value. >During batch mod, however, fields that aren't editied have no value, so forcing permanent_location >to pass through forces blanking it. > >This patch alters the script to only pass thgouhr for edit the fields that have been updated or >cleared. > >To test: > 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor > 2 - In mappings map that subfield to items.permanent_location > 3 - Set an item to have differing shelving location and permanent_location > 4 - This saves correctly for an individual item > 5 - Edit the item using Tools->batch item modification, updating the note field > 6 - Note the permanet_location is removed > 7 - Check the DB, the field is set to NULL > 8 - Apply patch > 9 - Repeat >10 - Permanent location is not cleared >11 - Verify that clearing fields works as before, including permanent_location >--- > tools/batchMod.pl | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 4f0efe833e..03a5897446 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -126,6 +126,15 @@ if ($op eq "action") { > my $values_to_modify = scalar(grep {!/^$/} @values) || scalar(grep {!/^$/} @searches); > my $values_to_blank = scalar(@disabled); > >+ # Clear the fields we are not editing, leave fields we are blanking >+ foreach( my $i = 0; $i < scalar @values; $i++ ){ >+ unless( $values[$i] || grep { $subfields[$i] } @disabled ){ >+ splice(@values,$i,1); >+ splice(@subfields,$i,1); >+ splice(@tags,$i,1); >+ } >+ } >+ > my $marcitem; > > #initializing values for updates >@@ -244,7 +253,6 @@ if ($op eq "action") { > } > } > } >- > $modified += UpdateMarcWith( $marcitem, $localmarcitem ); > if ($modified) { > eval { >-- >2.20.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 28832
:
123654
|
123966
|
123982
|
125075
|
125076
|
125077
|
127982
|
129991
|
129992
|
129993
|
129994