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

(-)a/Koha/Object/Mixin/AdditionalFields.pm (-5 / +12 lines)
Lines 65-77 sub set_additional_fields { Link Here
65
            my ($tag, $subfield) = split /\$/, $field->marcfield;
65
            my ($tag, $subfield) = split /\$/, $field->marcfield;
66
            my $marc_field = $record->field($tag);
66
            my $marc_field = $record->field($tag);
67
            if ($field->marcfield_mode eq 'get') {
67
            if ($field->marcfield_mode eq 'get') {
68
                $value = $marc_field ? $marc_field->subfield($subfield) : '';
68
                if ($subfield) {
69
            } elsif ($field->marcfield_mode eq 'set') {
69
                    $value = $marc_field ? $marc_field->subfield($subfield) : '';
70
                if ($marc_field) {
71
                    $marc_field->update($subfield => $value);
72
                } else {
70
                } else {
71
                    $value = $marc_field ? $marc_field->data() : '';
72
                }
73
            } elsif ($field->marcfield_mode eq 'set') {
74
                if ( $marc_field and $subfield ) {
75
                    $marc_field->update( $subfield => $value );
76
                } elsif ($marc_field) {
77
                    $marc_field->update($value);
78
                } elsif ($subfield) {
73
                    $marc_field = MARC::Field->new($tag, '', '', $subfield => $value);
79
                    $marc_field = MARC::Field->new($tag, '', '', $subfield => $value);
74
                    $record->append_fields($marc_field);
80
                    $record->append_fields($marc_field);
81
                } else {
82
                    $marc_field = MARC::Field->new( $tag, '', '', $value );
75
                }
83
                }
76
                $record_updated = 1;
84
                $record_updated = 1;
77
            }
85
            }
78
- 

Return to bug 34989