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 <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
(cherry picked from commit f669f00c1c)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
David Cook 2026-01-20 00:29:57 +00:00 committed by Jacob O'Mara
parent b31c0d9cb1
commit e518609cf1
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

View File

@ -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 %]