@@ -, +, @@ itemtype to 1 second record. You should not be able to but you can! --- C4/Reserves.pm | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -513,7 +513,6 @@ sub CanItemBeReserved{ return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0; my $controlbranch = C4::Context->preference('ReservesControlBranch'); - my $itemtypefield = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype"; # we retrieve user rights on this itemtype and branchcode my $sth = $dbh->prepare("SELECT categorycode, itemtype, branchcode, reservesallowed @@ -561,7 +560,14 @@ sub CanItemBeReserved{ $querycount .= "AND $branchfield = ?"; - $querycount .= " AND $itemtypefield = ?" if ($ruleitemtype ne "*"); + # If using item-level itypes, fall back to the record + # level itemtype if the hold has no associated item + $querycount .= + C4::Context->preference('item-level_itypes') + ? " AND COALESCE( itype, itemtype ) = ?" + : " AND itemtype = ?" + if ( $ruleitemtype ne "*" ); + my $sthcount = $dbh->prepare($querycount); if($ruleitemtype eq "*"){ --