Bugzilla – Attachment 188254 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: Add C4::Output::redirect_if_opac_hidden()
Bug-27734-Add-C4Outputredirectifopachidden.patch (text/plain), 1.71 KB, created by
Lari Taskula
on 2025-10-21 17:59:35 UTC
(
hide
)
Description:
Bug 27734: Add C4::Output::redirect_if_opac_hidden()
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-10-21 17:59:35 UTC
Size:
1.71 KB
patch
obsolete
>From ab9cbbf698f8659a6822df60f1bb1bb4cc81ac24 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 21 Oct 2025 15:03:50 +0300 >Subject: [PATCH] Bug 27734: Add C4::Output::redirect_if_opac_hidden() > >To test: >1. prove t/db_dependent/Output.t >--- > C4/Output.pm | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > >diff --git a/C4/Output.pm b/C4/Output.pm >index 3aaf1c05838..894b93194de 100644 >--- a/C4/Output.pm >+++ b/C4/Output.pm >@@ -46,6 +46,7 @@ BEGIN { > setlanguagecookie getlanguagecookie pagination_bar parametrized_url > output_html_with_http_headers output_ajax_with_http_headers output_with_http_headers > output_and_exit_if_error output_and_exit output_error >+ redirect_if_opac_hidden > redirect_if_opac_suppressed > ); > } >@@ -430,6 +431,32 @@ sub parametrized_url { > return $ret; > } > >+=item redirect_if_opac_hidden >+ >+ redirect_if_opac_hidden( $query, $biblio, $patron ); >+ >+For a given I<Koha::Biblio> and I<Koha::Patron> object, it handles redirection >+if it is hidden from the OPAC. >+ >+=cut >+ >+sub redirect_if_opac_hidden { >+ my ( $query, $biblio, $patron ) = @_; >+ >+ if ( $patron and $patron->category->override_hidden_items ) { >+ return; >+ } >+ >+ if ( $biblio->hidden_in_opac( { rules => C4::Context->yaml_preference('OpacHiddenItems') } ) ) { >+ if ( C4::Context->preference("OpacHiddenRecordRedirect") ) { >+ print $query->redirect("/cgi-bin/koha/opac-blocked.pl?hidden=1"); >+ } else { >+ print $query->redirect('/cgi-bin/koha/errors/404.pl'); >+ } >+ C4::Auth::safe_exit(); >+ } >+} >+ > =item redirect_if_opac_suppressed > > redirect_if_opac_suppressed( $query, $biblio ) >-- >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