Lines 141-148
sub copy_and_replace_field {
Link Here
|
141 |
if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; } |
141 |
if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; } |
142 |
|
142 |
|
143 |
|
143 |
|
144 |
if ( not $fromSubfieldName or $fromSubfieldName eq '' |
144 |
if ( !defined $fromSubfieldName or $fromSubfieldName eq '' |
145 |
or not $toSubfieldName or $toSubfieldName eq '' |
145 |
or !defined $toSubfieldName or $toSubfieldName eq '' |
146 |
) { |
146 |
) { |
147 |
_copy_move_field( |
147 |
_copy_move_field( |
148 |
{ record => $record, |
148 |
{ record => $record, |
Lines 480-488
sub move_field {
Link Here
|
480 |
my $regex = $params->{regex}; |
480 |
my $regex = $params->{regex}; |
481 |
my $field_numbers = $params->{field_numbers} // []; |
481 |
my $field_numbers = $params->{field_numbers} // []; |
482 |
|
482 |
|
483 |
if ( not $fromSubfieldName |
483 |
if ( !defined $fromSubfieldName |
484 |
or $fromSubfieldName eq '' |
484 |
or $fromSubfieldName eq '' |
485 |
or not $toSubfieldName |
485 |
or !defined $toSubfieldName |
486 |
or $toSubfieldName eq '' ) { |
486 |
or $toSubfieldName eq '' ) { |
487 |
_copy_move_field( |
487 |
_copy_move_field( |
488 |
{ record => $record, |
488 |
{ record => $record, |
Lines 564-569
sub _delete_subfield {
Link Here
|
564 |
|
564 |
|
565 |
foreach my $field ( @fields ) { |
565 |
foreach my $field ( @fields ) { |
566 |
$field->delete_subfield( code => $subfieldName ); |
566 |
$field->delete_subfield( code => $subfieldName ); |
|
|
567 |
$record->delete_field( $field ) unless $field->subfields(); |
567 |
} |
568 |
} |
568 |
} |
569 |
} |
569 |
|
570 |
|