Bug 23530: Fix cart showing only hidden items

Items hidden with the OpacHiddenItems system preference
were still displayed in the OPAC cart and the normal items
were hidden instead. This patch corrects the display.

To test:
- prep a test bib with hidden and other items using
  the OpacHiddenItems system preference
- add bib to cart
- observe that hidden items are displayed - non-hidden items are hidden
- apply patch, reload page
- observe that hidden items are hidden, non-hidden items are displayed

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 60ce66b6b6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Mason James 2019-09-03 16:02:32 +12:00 committed by Fridolin Somers
parent 64825cb321
commit 6e013cf383
1 changed files with 4 additions and 3 deletions

View File

@ -18,7 +18,6 @@
use Modern::Perl;
use CGI qw ( -utf8 );
use List::Util qw/none/; # well just one :)
use C4::Koha;
use C4::Biblio;
@ -100,12 +99,14 @@ foreach my $biblionumber ( @bibs ) {
# copy the visible ones into the items array.
my @items;
foreach my $item (@all_items) {
if ( none { $item->{itemnumber} ne $_ } @hidden_items ) {
# next if item is hidden
next if grep { $item->{itemnumber} eq $_ } @hidden_items ;
my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber});
if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; }
if( $reserve_status eq "Reserved"){ $item->{'onhold'} = 1; }
push @items, $item;
}
}
my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));