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

(-)a/C4/Suggestions.pm (-4 / +4 lines)
Lines 617-635 sub MarcRecordFromNewSuggestion { Link Here
617
617
618
    if (my $isbn = $suggestion->{isbn}) {
618
    if (my $isbn = $suggestion->{isbn}) {
619
        for my $field (qw(biblioitems.isbn biblioitems.issn)) {
619
        for my $field (qw(biblioitems.isbn biblioitems.issn)) {
620
            my ($tag, $subfield) = GetMarcFromKohaField($field, '');
620
            my ($tag, $subfield) = GetMarcFromKohaField($field);
621
            $record->append_fields(
621
            $record->append_fields(
622
                MARC::Field->new($tag, ' ', ' ', $subfield => $isbn)
622
                MARC::Field->new($tag, ' ', ' ', $subfield => $isbn)
623
            );
623
            );
624
        }
624
        }
625
    }
625
    }
626
    else {
626
    else {
627
        my ($title_tag, $title_subfield) = GetMarcFromKohaField('biblio.title', '');
627
        my ($title_tag, $title_subfield) = GetMarcFromKohaField('biblio.title');
628
        $record->append_fields(
628
        $record->append_fields(
629
            MARC::Field->new($title_tag, ' ', ' ', $title_subfield => $suggestion->{title})
629
            MARC::Field->new($title_tag, ' ', ' ', $title_subfield => $suggestion->{title})
630
        );
630
        );
631
631
632
        my ($author_tag, $author_subfield) = GetMarcFromKohaField('biblio.author', '');
632
        my ($author_tag, $author_subfield) = GetMarcFromKohaField('biblio.author');
633
        if ($record->field( $author_tag )) {
633
        if ($record->field( $author_tag )) {
634
            $record->field( $author_tag )->add_subfields( $author_subfield => $suggestion->{author} );
634
            $record->field( $author_tag )->add_subfields( $author_subfield => $suggestion->{author} );
635
        }
635
        }
Lines 640-646 sub MarcRecordFromNewSuggestion { Link Here
640
        }
640
        }
641
    }
641
    }
642
642
643
    my ($it_tag, $it_subfield) = GetMarcFromKohaField('biblioitems.itemtype', '');
643
    my ($it_tag, $it_subfield) = GetMarcFromKohaField('biblioitems.itemtype');
644
    if ($record->field( $it_tag )) {
644
    if ($record->field( $it_tag )) {
645
        $record->field( $it_tag )->add_subfields( $it_subfield => $suggestion->{itemtype} );
645
        $record->field( $it_tag )->add_subfields( $it_subfield => $suggestion->{itemtype} );
646
    }
646
    }
(-)a/t/db_dependent/Suggestions.t (-2 / +1 lines)
Lines 667-673 subtest 'Suggestion with ISBN' => sub { Link Here
667
    is($record->field( $title_tag), undef, "Record from suggestion title should be empty");
667
    is($record->field( $title_tag), undef, "Record from suggestion title should be empty");
668
668
669
    my ($author_tag, $author_subfield) = C4::Biblio::GetMarcFromKohaField('biblio.author', '');
669
    my ($author_tag, $author_subfield) = C4::Biblio::GetMarcFromKohaField('biblio.author', '');
670
    is($record->field( $author_tag), undef, "Record from suggestion author should be emtpy");
670
    is($record->field( $author_tag), undef, "Record from suggestion author should be empty");
671
};
671
};
672
672
673
$schema->storage->txn_rollback;
673
$schema->storage->txn_rollback;
674
- 

Return to bug 30195