From ccac7be5fbc6d9bc9a4a4b2ed31147ab17f7639e Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 20 Jan 2026 00:29:57 +0000 Subject: [PATCH] Bug 41665: Only include Greybox in OPAC if IdRef is enabled This patch wraps the Greybox include in the OPAC with a syspref check on IdRef, so that it's only loaded when it's needed. Test plan: 0. Apply the patch 1. Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=29 2. Search through the HTML or the Sources tab in F12 tools and note that Greybox assets are not loaded 3. Enable the IdRef system preference 4. Note that the Greybox assets are loaded Signed-off-by: Owen Leonard --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 63e004d0291..57067e90d32 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1624,7 +1624,9 @@ [% Asset.js("js/modals/catalog_concern.js") | $raw %] [% END %] [% INCLUDE 'datatables.inc' %] - [% INCLUDE greybox.inc %] + [% IF ( Koha.Preference('IdRef') ) %] + [% INCLUDE greybox.inc %] + [% END %] [% IF ( OpacStarRatings != 'disable' ) %] [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %] [% Asset.js("js/ratings.js") | $raw %] -- 2.39.5