From b4035c5a0c11c0671b4f26337fd41187f1d5cead Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Fri, 17 Apr 2026 16:00:22 +0200 Subject: [PATCH] Bug 42292: (follow-up) Fix duplicate NovelistSelectProfile declaration In the new tt-allowed block, the NovelistSelect fallback declarations redeclare `NovelistSelectProfile` instead of also exposing `NovelistSelectPassword`: var NovelistSelectProfile = "[% NovelistSelectProfile | html %]"; var NovelistSelectProfile = "[% NovelistSelectPassword | html %]"; So `NovelistSelectProfile` ends up holding the password, and `NovelistSelectPassword` is never declared. The later `novSelect.loadContentForQuery(..., NovelistSelectProfile, NovelistSelectPassword, ...)` call then throws ReferenceError and NovelistSelect content never loads on biblio detail pages. Rename the second declaration to `NovelistSelectPassword` to match the original template behaviour. To test: - Configure the NovelistSelect sysprefs (NovelistSelectEnabled, NovelistSelectProfile, NovelistSelectPassword) in the OPAC. Real NovelistSelect content only loads with valid EBSCO subscription credentials -- with dummy values the JS path still runs but the tab stays empty; that is still sufficient to verify this fix. - Open an OPAC biblio detail page with a known ISBN. - In the browser console, run console.log(NovelistSelectProfile, NovelistSelectPassword) and confirm both values are printed (before the fix, NovelistSelectPassword is undefined). - With valid subscription credentials, NovelistSelect content loads in its tab/panel instead of throwing a ReferenceError in the console. Signed-off-by: Paul Derscheid Signed-off-by: Jan Kissig Signed-off-by: Pedro Amorim --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- 1 file changed, 1 insertion(+), 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 203412502a..ed20436cb1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1678,7 +1678,7 @@ [% IF NovelistSelectProfile %] var NovelistSelectProfile = "[% NovelistSelectProfile | html %]"; - var NovelistSelectProfile = "[% NovelistSelectPassword | html %]"; + var NovelistSelectPassword = "[% NovelistSelectPassword | html %]"; var normalized_isbn = "[% normalized_isbn | html %]"; var normalized_upc = "[% normalized_upc | html %]"; [% END %]