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

(-)a/Koha/Biblio.pm (+9 lines)
Lines 1972-1977 sub generate_marc_host_field { Link Here
1972
            my $t = $f245c->as_string;
1972
            my $t = $f245c->as_string;
1973
            $t =~ s/[\s\/\\.]+$//;
1973
            $t =~ s/[\s\/\\.]+$//;
1974
            my $nonfiling = $f245c->indicator('2') // 0;
1974
            my $nonfiling = $f245c->indicator('2') // 0;
1975
            $nonfiling = 0 unless $nonfiling =~ /^\d+$/;
1975
            $t = ucfirst substr( $t, $nonfiling );
1976
            $t = ucfirst substr( $t, $nonfiling );
1976
            push @sfd, ( 't' => $t );
1977
            push @sfd, ( 't' => $t );
1977
        }
1978
        }
Lines 1985-1990 sub generate_marc_host_field { Link Here
1985
            }
1986
            }
1986
        }
1987
        }
1987
1988
1989
        # Subfield s - uniform title from 240
1990
        if ( my $f240 = $marc_host->field('240') ) {
1991
            my $s = $f240->as_string('a');
1992
            if ($s) {
1993
                push @sfd, ( 's' => $s );
1994
            }
1995
        }
1996
1988
        # Subfield d - publication info from 264/260
1997
        # Subfield d - publication info from 264/260
1989
        my $d;
1998
        my $d;
1990
        my @publication_fields = $marc_host->field('264');
1999
        my @publication_fields = $marc_host->field('264');
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +10 lines)
Lines 1016-1022 subtest 'get_volumes_query' => sub { Link Here
1016
};
1016
};
1017
1017
1018
subtest 'generate_marc_host_field' => sub {
1018
subtest 'generate_marc_host_field' => sub {
1019
    plan tests => 35;
1019
    plan tests => 36;
1020
1020
1021
    $schema->storage->txn_begin;
1021
    $schema->storage->txn_begin;
1022
1022
Lines 1101-1106 subtest 'generate_marc_host_field' => sub { Link Here
1101
    $link   = $biblio->generate_marc_host_field();
1101
    $link   = $biblio->generate_marc_host_field();
1102
    is( $link->subfield('t'), 'The capital test', "Title is capitalized after indicator offset" );
1102
    is( $link->subfield('t'), 'The capital test', "Title is capitalized after indicator offset" );
1103
1103
1104
    # 240 uniform title tests
1105
    $record->append_fields(
1106
        MARC::Field->new( '240', '1', '0', 'a' => 'Bible. English', 'l' => 'English' )
1107
    );
1108
    ($biblio_id) = AddBiblio( $record, qw{} );
1109
    $biblio = Koha::Biblios->find($biblio_id);
1110
    $link   = $biblio->generate_marc_host_field();
1111
    is( $link->subfield('s'), 'Bible. English', "Subfield s contains uniform title from 240a" );
1112
1104
    # 260/264 handling tests
1113
    # 260/264 handling tests
1105
    $record->append_fields(
1114
    $record->append_fields(
1106
        MARC::Field->new( '264', '', '', a => 'Publication 264' ),
1115
        MARC::Field->new( '264', '', '', a => 'Publication 264' ),
1107
- 

Return to bug 39545