Bug 15448: (follow-up) Adapt to changes on bug 24254
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 21 Dec 2020 19:30:31 +0000 (16:30 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 14 Jan 2021 13:03:49 +0000 (14:03 +0100)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
opac/opac-reserve.pl

index f893deb..eb8c266 100755 (executable)
@@ -72,11 +72,6 @@ for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
 
 my $patron = Koha::Patrons->find( $borrowernumber, { prefetch => ['categorycode'] } );
 my $category = $patron->category;
-# no OpacHiddenItems rules used if category is excepted
-my $item_hide_rules =
-    ( $category->override_hidden_items )
-    ? {}
-    : C4::Context->yaml_preference('OpacHiddenItems');
 
 my $can_place_hold_if_available_at_pickup = C4::Context->preference('OPACHoldsIfAvailableAtPickup');
 unless ( $can_place_hold_if_available_at_pickup ) {
@@ -467,7 +462,7 @@ foreach my $biblioNum (@biblionumbers) {
     my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode });
     my $notforloan_label_of = { map { $_->authorised_value => $_->opac_description } @notforloan_avs };
 
-    my $visible_items = { map { $_->itemnumber => 1 } $biblio->items->filter_by_visible_in_opac( { rules => $item_hide_rules } ) };
+    my $visible_items = { map { $_->itemnumber => 1 } $biblio->items->filter_by_visible_in_opac( { patron => $patron } ) };
 
     # Only keep the items that are visible in the opac (i.e. those in %visible_items)
     # FIXME: We should get rid of itemInfos altogether and use $visible_items