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

(-)a/C4/Reserves.pm (+6 lines)
Lines 306-311 sub CanBookBeReserved{ Link Here
306
        return 'tooManyReserves';
306
        return 'tooManyReserves';
307
    }
307
    }
308
308
309
    # Check for the age restriction
310
    my $biblioData = C4::Biblio::GetBiblioData( $biblionumber );
311
    my $borrower = $patron->unblessed;
312
    my ($ageRestriction, $daysToAgeRestriction) = C4::Circulation::GetAgeRestriction( $biblioData->{agerestriction}, $borrower );
313
    return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0;
314
309
    my $items = GetItemnumbersForBiblio($biblionumber);
315
    my $items = GetItemnumbersForBiblio($biblionumber);
310
    #get items linked via host records
316
    #get items linked via host records
311
    my @hostitems = get_hostitemnumbers_of($biblionumber);
317
    my @hostitems = get_hostitemnumbers_of($biblionumber);
(-)a/t/db_dependent/Reserves.t (-2 / +5 lines)
Lines 55-61 my $builder = t::lib::TestBuilder->new; Link Here
55
my $frameworkcode = q||;
55
my $frameworkcode = q||;
56
56
57
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached
57
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached
58
$dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a' and frameworkcode=?", undef, $frameworkcode);
58
$dbh->do(q|
59
    INSERT INTO marc_subfield_structure (frameworkcode, tagfield, tagsubfield, kohafield)
60
    VALUES ('', '521', 'a', 'biblioitems.agerestriction')
61
    ON DUPLICATE KEY UPDATE kohafield = VALUES(kohafield)
62
|);
59
my $cache = Koha::Caches->get_instance;
63
my $cache = Koha::Caches->get_instance;
60
$cache->clear_from_cache("MarcStructure-0-$frameworkcode");
64
$cache->clear_from_cache("MarcStructure-0-$frameworkcode");
61
$cache->clear_from_cache("MarcStructure-1-$frameworkcode");
65
$cache->clear_from_cache("MarcStructure-1-$frameworkcode");
62
- 

Return to bug 11999