Bugzilla – Attachment 142052 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: Avoid unecessary loop
Bug-31154-Avoid-unecessary-loop.patch (text/plain), 1.46 KB, created by
Marcel de Rooy
on 2022-10-18 11:41:06 UTC
(
hide
)
Description:
Bug 31154: Avoid unecessary loop
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-10-18 11:41:06 UTC
Size:
1.46 KB
patch
obsolete
>From 63a670feaccc4546d71530830d659dc27528f658 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 17 Oct 2022 16:00:25 +0200 >Subject: [PATCH] Bug 31154: Avoid unecessary loop >Content-Type: text/plain; charset=utf-8 > >We don't need to loop over the subfield and enter this block if there is >no record. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/UI/Form/Builder/Item.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm >index 429f88cb58..a1fd36c00b 100644 >--- a/Koha/UI/Form/Builder/Item.pm >+++ b/Koha/UI/Form/Builder/Item.pm >@@ -152,7 +152,8 @@ sub generate_subfield_form { > && !$value > && $subfield->{kohafield} > && $subfield->{kohafield} eq 'items.itemcallnumber' >- && $pref_itemcallnumber ) >+ && $pref_itemcallnumber >+ && $marc_record ) > { > foreach > my $pref_itemcallnumber_part ( split( /,/, $pref_itemcallnumber ) ) >@@ -162,7 +163,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 ? $marc_record->field($CNtag) : undef; >+ my $temp2 = $marc_record->field($CNtag); > > next unless $temp2; > $value = $temp2->as_string( $CNsubfields, ' ' ); >-- >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