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>
This commit is contained in:
parent
edf8640cff
commit
b582f7d495
|
|
@ -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, ' ' );
|
||||
|
|
|
|||
Loading…
Reference in New Issue