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

(-)a/Koha/Biblio.pm (+15 lines)
Lines 370-375 sub biblioitem { Link Here
370
    return $self->{_biblioitem};
370
    return $self->{_biblioitem};
371
}
371
}
372
372
373
=head3 title_remainder
374
375
my $field = $self->title_remainder
376
377
Returns the Remainder of title, 245$b.
378
379
=cut
380
381
sub title_remainder {
382
    my ($self) = @_;
383
384
    return unless my $record = C4::Biblio::GetMarcBiblio($self->biblionumber);
385
    return $record->subfield('245','b');
386
}
387
373
=head3 type
388
=head3 type
374
389
375
=cut
390
=cut
(-)a/t/db_dependent/Koha/Biblios.t (-3 / +11 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 2;
22
use Test::More tests => 3;
23
23
24
use C4::Biblio;
24
use C4::Biblio;
25
use C4::Items;
25
use C4::Items;
Lines 116-121 subtest 'can_be_transferred' => sub { Link Here
116
       .' invalid library is given.');
116
       .' invalid library is given.');
117
};
117
};
118
118
119
subtest 'title_remainder' => sub {
120
    plan tests => 1;
121
122
    my ($bibnum, $title, $bibitemnum) = create_helper_biblio('BK');
123
124
    my $biblio = Koha::Biblios->find($bibnum);
125
    is($biblio->title_remainder, 'Remainder', 'Got remainder of title');
126
};
127
119
$schema->storage->txn_rollback;
128
$schema->storage->txn_rollback;
120
129
121
130
Lines 127-133 sub create_helper_biblio { Link Here
127
    $title = 'Silence in the library';
136
    $title = 'Silence in the library';
128
    $bib->append_fields(
137
    $bib->append_fields(
129
        MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
138
        MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
130
        MARC::Field->new('245', ' ', ' ', a => $title),
139
        MARC::Field->new('245', ' ', ' ', a => $title, b => 'Remainder'),
131
        MARC::Field->new('942', ' ', ' ', c => $itemtype),
140
        MARC::Field->new('942', ' ', ' ', c => $itemtype),
132
    );
141
    );
133
    return ($bibnum, $title, $bibitemnum) = AddBiblio($bib, '');
142
    return ($bibnum, $title, $bibitemnum) = AddBiblio($bib, '');
134
- 

Return to bug 18408