Bugzilla – Attachment 175808 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: Replace OpacHiddenRecordMessage system preference with HTML customization
Bug-27734-Replace-OpacHiddenRecordMessage-system-p.patch (text/plain), 9.33 KB, created by
Roman Dolny
on 2024-12-19 22:24:47 UTC
(
hide
)
Description:
Bug 27734: Replace OpacHiddenRecordMessage system preference with HTML customization
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-12-19 22:24:47 UTC
Size:
9.33 KB
patch
obsolete
>From 05dd34e3a13c95de1b9bc08e589578b239578213 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Wed, 9 Jun 2021 19:29:19 +0000 >Subject: [PATCH] Bug 27734: Replace OpacHiddenRecordMessage system preference > with HTML customization > >This patch replaces OpacHiddenRecordMessage preference with an HTML customization >of the same name. > >Test plan: >1 - Apply patch >2 - Test OpacSupressionsRedirect and OpacSuppressionMessage prefs to ensure they work as before >3 - Set preference OpacHiddenRecordRedirect on and create HTML customization OpacHiddenRecordMessage >4 - Enable OpacHiddenItemsHidesRecord and hide a biblio using OpacHiddenItems: > biblionumber: [303] >5 - Test OpacHiddenRecordRedirect and OpacHiddenRecordMessage to ensure they work as expected >6 - Hit the link: http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=303 >7 - When OpacHiddenRecordRedirect set to 404 you get a 404 >8 - When OpacHiddenRecordRedirect set to 'an explanatory page' you get 'opac-blocked.pl' >9 - If you set a message in OpacHiddenRecordMessage it displays on opac-blocked.pl > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > installer/data/mysql/atomicupdate/bug_27734.perl | 7 ++----- > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../prog/en/includes/html-customization-help.inc | 4 ++++ > .../prog/en/modules/admin/preferences/opac.pref | 5 +---- > .../prog/en/modules/tools/additional-contents.tt | 2 +- > .../bootstrap/en/modules/opac-blocked.tt | 15 +++++++-------- > 6 files changed, 15 insertions(+), 19 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_27734.perl b/installer/data/mysql/atomicupdate/bug_27734.perl >index 990b4b6672..9c65a21bda 100644 >--- a/installer/data/mysql/atomicupdate/bug_27734.perl >+++ b/installer/data/mysql/atomicupdate/bug_27734.perl >@@ -4,9 +4,6 @@ if( CheckVersion( $DBversion ) ) { > INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES > ('OpacHiddenRecordRedirect','0','Redirect the opac detail page for records hidden by OpacHiddenItems to an explanatory page (otherwise redirect to 404 error page)','','YesNo') > }); >- $dbh->do(q{ >- INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >- ('OpacHiddenRecordMessage','','Display this message on the redirect page for hidden biblios','70|10','Textarea') >- }); >- NewVersion( $DBversion, 27734, "Add OpacHiddenRecordRedirect and OpacHiddenRecordMessage preferences"); >+ >+ NewVersion( $DBversion, 27734, "Add OpacHiddenRecordRedirect preference"); > } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index dde0db602e..cf85a465a0 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -498,7 +498,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpacHiddenItemsExceptions','',NULL,'List of borrower categories, separated by comma, that can see items otherwise hidden by OpacHiddenItems','Textarea'), > ('OpacHiddenItemsHidesRecord','1','','Hide biblio record when all its items are hidden because of OpacHiddenItems','YesNo'), > ('OpacHiddenRecordRedirect','0','Redirect the opac detail page for records hidden by OpacHiddenItems to an explanatory page (otherwise redirect to 404 error page)','','YesNo'), >-('OpacHiddenRecordMessage','','Display this message on the redirect page for hidden biblios','70|10','Textarea'), > ('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'), > ('OPACHoldingsDefaultSortField','first_column','first_column|homebranch|holdingbranch','Default sort field for the holdings table at the OPAC','choice'), > ('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >index d33c36cc8d..fc9963e05c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >@@ -38,6 +38,10 @@ > Include this content in the header of all pages in the OPAC. > </div> > >+<div id="OpacHiddenRecordMessage_notes" class="hint customization_note"> >+ Display the following message on the redirect page for hidden bibliographic records. Depends on the system preferences OpacHiddenItems and OpacHiddenRecordRedirect. >+</div> >+ > <div id="OpacLibraryInfo_notes" class="hint customization_note"> > Include this content on the library information page in the OPAC. > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 58d7752e8b..1ff0351673 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -655,10 +655,7 @@ OPAC: > choices: > 1: "an explanatory page ('This record is blocked')." > 0: "the 404 error page ('Not found')." >- - "<br />Display the following message on the redirect page for suppressed bibliographic records:" >- - pref: OpacHiddenRecordMessage >- type: textarea >- class: code >+ - "<br />Display a message on the redirect page for suppressed bibliographic records with HTML customization <strong>OpacHiddenRecordMessage</strong>." > - > - pref: OpacAllowPublicListCreation > default: 1 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index d5537d3928..a2b3fac2d8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -527,7 +527,7 @@ > [% END %] > [% END %] > [% ELSE %] >- [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions', 'ILLModuleCopyrightClearance' ] %] >+ [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacHiddenRecordMessage', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions', 'ILLModuleCopyrightClearance' ] %] > <optgroup label="OPAC"> > [% FOREACH l IN opac_available_options.sort %] > [% IF l == location %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-blocked.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-blocked.tt >index 1c7fbafba3..406298c92f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-blocked.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-blocked.tt >@@ -1,9 +1,9 @@ > [% USE raw %] > [% USE AdditionalContents %] > [% SET OpacSuppressionMessage = AdditionalContents.get( location => "OpacSuppressionMessage", lang => lang, library => branchcode || default_branch ) %] >+[% SET OpacHiddenRecordMessage = AdditionalContents.get( location => "OpacHiddenRecordMessage", lang => lang, library => branchcode || default_branch ) %] > [% PROCESS 'i18n.inc' %] > [% PROCESS 'html_helpers.inc' %] >-[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>[% FILTER collapse %] > [% t("Record blocked") | html %] › >@@ -27,14 +27,13 @@ > <div id="opac-blocked-message" class="maincontent"> > <h1>Record blocked</h1> > <p>You are not authorized to view this record.</p> >- [% IF hidden %] >- [% SET OpacBlockedMessage = Koha.Preference("OpacHiddenRecordMessage") %] >- [% ELSE %] >- [% SET OpacBlockedMessage = Koha.Preference("OpacSuppressionMessage") %] >- [% END %] >- [% IF ( OpacBlockedMessage ) %] >+ [% IF ( OpacSuppressionMessage ) || ( hidden ) %] > <div id="opacsuppressionmessage"> >- [% PROCESS koha_news_block news => OpacSuppressionMessage %] >+ [% IF hidden %] >+ [% PROCESS koha_news_block news => OpacHiddenRecordMessage %] >+ [% ELSE %] >+ [% PROCESS koha_news_block news => OpacSuppressionMessage %] >+ [% END %] > </div> > [% END %] > </div> >-- >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