View | Details | Raw Unified | Return to bug 26894
Collapse All | Expand All

(-)a/Koha/SimpleMARC.pm (-4 / +5 lines)
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
(-)a/t/db_dependent/MarcModificationTemplates.t (-10 / +8 lines)
Lines 700-705 sub expected_record_0 { Link Here
700
    my $record = MARC::Record->new;
700
    my $record = MARC::Record->new;
701
    $record->leader('03174nam a2200445 a 4500');
701
    $record->leader('03174nam a2200445 a 4500');
702
    my @fields = (
702
    my @fields = (
703
        MARC::Field->new(
704
            100, '1', ' ',
705
            a => 'Knuth, Donald Ervin',
706
            d => '1938',
707
        ),
703
        MARC::Field->new(
708
        MARC::Field->new(
704
            245, '1', '4',
709
            245, '1', '4',
705
            0 => '12345',
710
            0 => '12345',
Lines 713-721 sub expected_record_0 { Link Here
713
            9 => '462',
718
            9 => '462',
714
        ),
719
        ),
715
        MARC::Field->new(
720
        MARC::Field->new(
716
            600, '1', ' ',
721
            600, ' ', ' ',
717
            a => 'Knuth, Donald Ervin',
718
            d => '1938',
719
            0 => 'TestUpdated',
722
            0 => 'TestUpdated',
720
        ),
723
        ),
721
        MARC::Field->new(
724
        MARC::Field->new(
Lines 723-731 sub expected_record_0 { Link Here
723
            0 => 'TestUpdated',
726
            0 => 'TestUpdated',
724
        ),
727
        ),
725
        MARC::Field->new(
728
        MARC::Field->new(
726
            100, '1', ' ',
729
            100, ' ', ' ',
727
            a => 'Knuth, Donald Ervin',
728
            d => '1938',
729
            0 => 'TestUpdated',
730
            0 => 'TestUpdated',
730
        ),
731
        ),
731
        MARC::Field->new(
732
        MARC::Field->new(
Lines 733-742 sub expected_record_0 { Link Here
733
            0 => 'TestUpdated',
734
            0 => 'TestUpdated',
734
        ),
735
        ),
735
        MARC::Field->new(
736
        MARC::Field->new(
736
            700, '1', '4',
737
            700, ' ', ' ',
737
            0 => '12345',
738
            0 => '12345',
738
            a => 'The art of computer programming',
739
            c => 'Donald E. Knuth.',
740
        ),
739
        ),
741
    );
740
    );
742
    $record->append_fields(@fields);
741
    $record->append_fields(@fields);
743
- 

Return to bug 26894