Bug 31154: Avoid unecessary loop
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b582f7d495)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
8735f0732c
commit
23d0af2eab
|
|
@ -151,7 +151,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 ) )
|
||||
|
|
@ -161,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 ? $marc_record->field($CNtag) : undef;
|
||||
my $temp2 = $marc_record->field($CNtag);
|
||||
|
||||
next unless $temp2;
|
||||
$value = $temp2->as_string( $CNsubfields, ' ' );
|
||||
|
|
|
|||
Loading…
Reference in New Issue