Bugzilla – Attachment 140695 Details for
Bug 31154
Batch item modification fails when "Use default values" is checked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31154: (QA follow-up) Fix UI form builder
Bug-31154-QA-follow-up-Fix-UI-form-builder.patch (text/plain), 3.21 KB, created by
Marcel de Rooy
on 2022-09-16 09:19:44 UTC
(
hide
)
Description:
Bug 31154: (QA follow-up) Fix UI form builder
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-09-16 09:19:44 UTC
Size:
3.21 KB
patch
obsolete
>From d621089e2e2e10346c45d86e73c9c29f5940c62b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 16 Sep 2022 08:58:51 +0000 >Subject: [PATCH] Bug 31154: (QA follow-up) Fix UI form builder >Content-Type: text/plain; charset=utf-8 > >The change in batchMod.pl is not needed when we fix the builder. >But we could at least add a comment there! > >Note that passing the biblionumber of the first item does not >make sense since we are modifying items from several biblio >records normally. We most probably do not want this MARC >record's itemcallnumber (via the syspref) in all our items. > >Test plan: >Test batchMod with and without the Populate fields checkbox. >Fill syspref 'itemcallnumber' with e.g. 084a. >Check Populate, and try again. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/UI/Form/Builder/Item.pm | 6 +++--- > tools/batchMod.pl | 4 +--- > 2 files changed, 4 insertions(+), 6 deletions(-) > >diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm >index 5ccf67b523..429f88cb58 100644 >--- a/Koha/UI/Form/Builder/Item.pm >+++ b/Koha/UI/Form/Builder/Item.pm >@@ -162,7 +162,7 @@ sub generate_subfield_form { > my $CNsubfields = > substr( $pref_itemcallnumber_part, 3 ); # Any and all subfields > $CNsubfields = undef if $CNsubfields eq ''; >- my $temp2 = $marc_record->field($CNtag); >+ my $temp2 = $marc_record ? $marc_record->field($CNtag) : undef; > > next unless $temp2; > $value = $temp2->as_string( $CNsubfields, ' ' ); >@@ -314,7 +314,7 @@ sub generate_subfield_form { > ); > my $pars = { > dbh => $dbh, >- record => $marc_record, >+ record => $marc_record, #Note: could be undefined > tagslib => $tagslib, > id => $subfield_data{id}, > }; >@@ -564,7 +564,7 @@ sub edit_form { > value => $value, > tagslib => $tagslib, > libraries => $libraries, >- marc_record => $marc_record, >+ marc_record => $marc_record, #Note: could be undefined > restricted_edition => $restricted_edition, > prefill_with_default_values => $prefill_with_default_values, > branch_limit => $branch_limit, >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index fc5ba81a5c..31a61b7046 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -265,9 +265,7 @@ if ($op eq "show"){ > # Getting list of subfields to keep when restricted batchmod edit is enabled > my @subfields_to_allow = $restrictededition ? split ' ', C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod') : (); > >- $biblionumber = Koha::Items->find($itemnumbers[0])->unblessed->{biblionumber} if $itemnumbers[0]; >- my $subfields = Koha::UI::Form::Builder::Item->new( >- { biblionumber => $biblionumber } )->edit_form( >+ my $subfields = Koha::UI::Form::Builder::Item->new->edit_form( # NOTE: We are not passing a biblionumber intentionally ! > { > restricted_editition => $restrictededition, > ( >-- >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 31154
:
138124
|
140518
|
140602
|
140694
| 140695 |
141973
|
141974
|
142051
|
142052