Bugzilla – Attachment 188255 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), 3.99 KB, created by
Lari Taskula
on 2025-10-21 17:59:37 UTC
(
hide
)
Description:
Bug 27734: Use redirect_if_opac_hidden() in opac-*detail.pages
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-10-21 17:59:37 UTC
Size:
3.99 KB
patch
obsolete
>From 9a95b6c061d0aa7a772d573eafc123bf7589978a 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 > >--- > 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 45e83c393d4..165c77e7f33 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 03c2d18dd04..95f6062ffac 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 211dac36ea1..8736adb5744 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.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 27734
:
121749
|
121797
|
121988
|
121989
|
121990
|
173166
|
173167
|
173168
|
175807
|
175808
|
188253
|
188254
| 188255 |
188256