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

(-)a/C4/Reserves.pm (+6 lines)
Lines 339-344 sub CanBookBeReserved{ Link Here
339
        return 'tooManyReserves';
339
        return 'tooManyReserves';
340
    }
340
    }
341
341
342
    # Check for the age restriction
343
    my $biblioData = C4::Biblio::GetBiblioData( $biblionumber );
344
    my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
345
    my ($ageRestriction, $daysToAgeRestriction) = C4::Circulation::GetAgeRestriction( $biblioData->{agerestriction}, $borrower );
346
    return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0;
347
342
    my $items = GetItemnumbersForBiblio($biblionumber);
348
    my $items = GetItemnumbersForBiblio($biblionumber);
343
    #get items linked via host records
349
    #get items linked via host records
344
    my @hostitems = get_hostitemnumbers_of($biblionumber);
350
    my @hostitems = get_hostitemnumbers_of($biblionumber);
(-)a/t/db_dependent/Reserves.t (-2 / +5 lines)
Lines 53-59 my $builder = t::lib::TestBuilder->new; Link Here
53
my $frameworkcode = q||;
53
my $frameworkcode = q||;
54
54
55
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached
55
# Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached
56
$dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a' and frameworkcode=?", undef, $frameworkcode);
56
$dbh->do(q|
57
    INSERT INTO marc_subfield_structure (frameworkcode, tagfield, tagsubfield, kohafield)
58
    VALUES ('', '521', 'a', 'biblioitems.agerestriction')
59
    ON DUPLICATE KEY UPDATE kohafield = VALUES(kohafield)
60
|);
57
my $cache = Koha::Caches->get_instance;
61
my $cache = Koha::Caches->get_instance;
58
$cache->clear_from_cache("MarcStructure-0-$frameworkcode");
62
$cache->clear_from_cache("MarcStructure-0-$frameworkcode");
59
$cache->clear_from_cache("MarcStructure-1-$frameworkcode");
63
$cache->clear_from_cache("MarcStructure-1-$frameworkcode");
60
- 

Return to bug 11999