Bug 31154: (QA follow-up) Fix UI form builder
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 16 Sep 2022 08:58:51 +0000 (08:58 +0000)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Mon, 14 Nov 2022 16:27:58 +0000 (17:27 +0100)
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb292431401a7ed0782427412eb1208fa7716e4c)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e5c11f993369cbcd2507a604fece7254263f8ac0)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Koha/UI/Form/Builder/Item.pm

index 504cc38..6d8720c 100644 (file)
@@ -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, ' ' );