Bugzilla – Attachment 190814 Details for
Bug 27734
OpacHiddenItems produces a 404 from borrower holds list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27734: Use redirect_if_opac_hidden() in opac-*detail.pages
Bug-27734-Use-redirectifopachidden-in-opac-detailp.patch (text/plain), 4.03 KB, created by
David Nind
on 2026-01-01 20:22:13 UTC
(
hide
)
Description:
Bug 27734: Use redirect_if_opac_hidden() in opac-*detail.pages
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-01-01 20:22:13 UTC
Size:
4.03 KB
patch
obsolete
>From f2c7ac478ce9288c34af7affcc6d19e20b33eb59 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 21 Oct 2025 14:48:07 +0300 >Subject: [PATCH] Bug 27734: Use redirect_if_opac_hidden() in > opac-*detail.pages > >Signed-off-by: David Nind <david@davidnind.com> >--- > opac/opac-ISBDdetail.pl | 12 ++---------- > opac/opac-MARCdetail.pl | 12 ++---------- > opac/opac-detail.pl | 7 ++----- > 3 files changed, 6 insertions(+), 25 deletions(-) > >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index 45e83c393d..165c77e7f3 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -42,7 +42,7 @@ use Modern::Perl; > > use C4::Auth qw( get_template_and_user ); > use C4::Context; >-use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed ); >+use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_hidden redirect_if_opac_suppressed ); > use CGI qw ( -utf8 ); > use C4::Biblio qw( > CountItemsIssued >@@ -93,15 +93,7 @@ my $patron = Koha::Patrons->find($loggedinuser); > > my $opachiddenitems_rules = C4::Context->yaml_preference('OpacHiddenItems'); > >-unless ( $patron and $patron->category->override_hidden_items ) { >- >- # only skip this check if there's a logged in user >- # and its category overrides OpacHiddenItems >- if ( $biblio->hidden_in_opac( { rules => $opachiddenitems_rules } ) ) { >- print $query->redirect('/cgi-bin/koha/errors/404.pl'); # escape early >- exit; >- } >-} >+redirect_if_opac_hidden( $query, $biblio, $patron ); > > my $record = $biblio->metadata->record; > my @items = $biblio->items->filter_by_visible_in_opac( { patron => $patron } )->as_list; >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index 03c2d18dd0..95f6062ffa 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -46,7 +46,7 @@ use Modern::Perl; > > use C4::Auth qw( get_template_and_user ); > use C4::Context; >-use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed ); >+use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_hidden redirect_if_opac_suppressed ); > use CGI qw ( -utf8 ); > use C4::Biblio qw( > CountItemsIssued >@@ -100,15 +100,7 @@ if ( !$biblio ) { > redirect_if_opac_suppressed( $query, $biblio ) > if C4::Context->preference('OpacSuppression'); > >-unless ( $patron and $patron->category->override_hidden_items ) { >- >- # only skip this check if there's a logged in user >- # and its category overrides OpacHiddenItems >- if ( $biblio->hidden_in_opac( { rules => C4::Context->yaml_preference('OpacHiddenItems') } ) ) { >- print $query->redirect('/cgi-bin/koha/errors/404.pl'); # escape early >- exit; >- } >-} >+redirect_if_opac_hidden( $query, $biblio, $patron ); > > my $metadata_extractor = $biblio->metadata_extractor; > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index edf609cb02..0475701585 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -33,7 +33,7 @@ use C4::Koha qw( > ); > use C4::Search qw( new_record_from_zebra searchResults getRecords ); > use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); >-use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed ); >+use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_hidden redirect_if_opac_suppressed ); > use C4::Biblio qw( > CountItemsIssued > GetBiblioData >@@ -127,10 +127,7 @@ unless ( $patron and $patron->category->override_hidden_items ) { > > # only skip this check if there's a logged in user > # and its category overrides OpacHiddenItems >- if ( $biblio->hidden_in_opac( { rules => C4::Context->yaml_preference('OpacHiddenItems') } ) ) { >- print $query->redirect('/cgi-bin/koha/errors/404.pl'); # escape early >- exit; >- } >+ redirect_if_opac_hidden( $query, $biblio, $patron ); > if ( $items->count >= 1 ) { > $items = $items->filter_by_visible_in_opac( { patron => $patron } ); > } >-- >2.39.5
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 27734
:
121749
|
121797
|
121988
|
121989
|
121990
|
173166
|
173167
|
173168
|
175807
|
175808
|
188253
|
188254
|
188255
|
188256
|
190812
|
190813
| 190814 |
190815