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

(-)a/Koha/SimpleMARC.pm (-4 / +6 lines)
Lines 674-682 sub _copy_move_subfield { Link Here
674
674
675
    # Find which source fields actually have the subfield to determine target field numbers
675
    # Find which source fields actually have the subfield to determine target field numbers
676
    my @target_field_numbers;
676
    my @target_field_numbers;
677
    if ( $fromFieldName eq $toFieldName && @values ) {
677
    if ( $fromFieldName eq $toFieldName && $fromSubfieldName ne $toSubfieldName && @values ) {
678
678
679
        # For same-field operations, find fields that have the source subfield
679
        # For same-field operations where subfields differ, find fields that have the source subfield
680
        # This prevents overwriting target subfields in fields that don't have the source subfield
680
        @target_field_numbers =
681
        @target_field_numbers =
681
            @{ field_exists( { record => $record, field => $fromFieldName, subfield => $fromSubfieldName } ) };
682
            @{ field_exists( { record => $record, field => $fromFieldName, subfield => $fromSubfieldName } ) };
682
        if (@$field_numbers) {
683
        if (@$field_numbers) {
Lines 694-700 sub _copy_move_subfield { Link Here
694
            subfield      => $toSubfieldName,
695
            subfield      => $toSubfieldName,
695
            values        => \@values,
696
            values        => \@values,
696
            dont_erase    => $dont_erase,
697
            dont_erase    => $dont_erase,
697
            field_numbers => @target_field_numbers ? \@target_field_numbers : $field_numbers
698
            field_numbers => @target_field_numbers
699
            ? \@target_field_numbers
700
            : ( $fromFieldName eq $toFieldName ? $field_numbers : [] )
698
        }
701
        }
699
    );
702
    );
700
703
701
- 

Return to bug 32950