Bugzilla – Attachment 173635 Details for
Bug 38286
Koha::Biblio:hidden_in_opac does not need to fetch the items if OpacHiddenItemsHidesRecord is set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38286: Do not fetch the items if OpacHiddenItemsHidesRecord is set
Bug-38286-Do-not-fetch-the-items-if-OpacHiddenItem.patch (text/plain), 1.31 KB, created by
Jonathan Druart
on 2024-10-29 12:54:40 UTC
(
hide
)
Description:
Bug 38286: Do not fetch the items if OpacHiddenItemsHidesRecord is set
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-10-29 12:54:40 UTC
Size:
1.31 KB
patch
obsolete
>From bcadf361936ba7674d9331fbef412db9c8a3b0ea Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 29 Oct 2024 13:52:48 +0100 >Subject: [PATCH] Bug 38286: Do not fetch the items if > OpacHiddenItemsHidesRecord is set > >Koha::Biblio:hidden_in_opac does not need to fetch the items if OpacHiddenItemsHidesRecord is set > >Test plan: > prove t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Item.t t/db_dependent/api/v1/biblios.t >Should return green > >Confirm the assumption above is correct. >--- > Koha/Biblio.pm | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index b8ae982b1de..d4d54eed42b 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -470,15 +470,14 @@ the I<OpacHiddenItems> system preference. > sub hidden_in_opac { > my ( $self, $params ) = @_; > >+ return 0 unless C4::Context->preference('OpacHiddenItemsHidesRecord'); >+ > my $rules = $params->{rules} // {}; > > my @items = $self->items->as_list; > > return 0 unless @items; # Do not hide if there is no item > >- # Ok, there are items, don't even try the rules unless OpacHiddenItemsHidesRecord >- return 0 unless C4::Context->preference('OpacHiddenItemsHidesRecord'); >- > return !(any { !$_->hidden_in_opac({ rules => $rules }) } @items); > } > >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38286
:
173635
|
173645