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

(-)a/Koha/Biblio.pm (-1 / +14 lines)
Lines 381-390 Returns the Remainder of title, 245$b. Link Here
381
sub title_remainder {
381
sub title_remainder {
382
    my ($self) = @_;
382
    my ($self) = @_;
383
383
384
    return unless my $record = C4::Biblio::GetMarcBiblio($self->biblionumber);
384
    $self->{_record} ||= C4::Biblio::GetMarcBiblio($self->biblionumber);
385
    return unless my $record = $self->{_record};
385
    return $record->subfield('245','b');
386
    return $record->subfield('245','b');
386
}
387
}
387
388
389
=head3 store
390
391
=cut
392
393
sub store {
394
    my ($self) = @_;
395
396
    $self->{_record} = undef;
397
398
    $self->SUPER::store;
399
}
400
388
=head3 type
401
=head3 type
389
402
390
=cut
403
=cut
(-)a/t/db_dependent/Koha/Biblios.t (-2 / +14 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 3;
22
use Test::More tests => 4;
23
23
24
use C4::Biblio;
24
use C4::Biblio;
25
use C4::Items;
25
use C4::Items;
Lines 125-130 subtest 'title_remainder' => sub { Link Here
125
    is($biblio->title_remainder, 'Remainder', 'Got remainder of title');
125
    is($biblio->title_remainder, 'Remainder', 'Got remainder of title');
126
};
126
};
127
127
128
subtest 'store' => sub {
129
    plan tests => 2;
130
131
    my ($bibnum, $title, $bibitemnum) = create_helper_biblio('BK');
132
133
    my $biblio = Koha::Biblios->find($bibnum);
134
    $biblio->title_remainder;
135
    is(ref($biblio->{_record}), 'MARC::Record',
136
       'MARC::Record is cached in the object');
137
    $biblio->store;
138
    is($biblio->{_record}, undef, 'store invalidates ->{_record}');
139
};
140
128
$schema->storage->txn_rollback;
141
$schema->storage->txn_rollback;
129
142
130
143
131
- 

Return to bug 18408