Bugzilla – Attachment 152918 Details for
Bug 34180
Template variable in JavaScript triggers error when showing authority MARC preview
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34180: Template variable in JavaScript prevents authority MARC preview from displaying
Bug-34180-Template-variable-in-JavaScript-prevents.patch (text/plain), 2.55 KB, created by
Owen Leonard
on 2023-06-30 20:10:58 UTC
(
hide
)
Description:
Bug 34180: Template variable in JavaScript prevents authority MARC preview from displaying
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-06-30 20:10:58 UTC
Size:
2.55 KB
patch
obsolete
>From 381a5decd1fced8712d630ddc4a861e375f1ed66 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 16 Nov 2022 12:10:16 +0000 >Subject: [PATCH] Bug 34180: Template variable in JavaScript prevents authority > MARC preview from displaying > >Since template variables cannot be processed by JS, we must use a >template to declare a JS variable which the JS file can used. This patch >corrects this problem in the JS file which handles display of the >authority MARC preview from the authority search results page. > >To test, apply the patch and go to Authorities. > >- Perform a search which will return multiple authority results. >- Click "Actions -> MARC preview." The preview should display correctly. >- Click "Actions -> MARC preview" on another search result. This preview > should also look correct. >- There should be no JavaScript errors in the browser console. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc | 2 +- > koha-tmpl/intranet-tmpl/prog/js/authorities-detail-modal.js | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >index 67d0eb6395..152feed293 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >@@ -88,8 +88,8 @@ $(document).ready(function () { > $("#header_search a[href='#entire_record']").tab("show"); > } > } >- > }); >+const template_path = "[% interface | html %]/[% theme | html %]"; > > </script> > <!-- / authorities_js.inc --> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/authorities-detail-modal.js b/koha-tmpl/intranet-tmpl/prog/js/authorities-detail-modal.js >index a53a53de38..d91b047258 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/authorities-detail-modal.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/authorities-detail-modal.js >@@ -1,3 +1,4 @@ >+/* global template_path */ > $(document).ready(function(){ > $(".authority_preview a").on("click", function(e){ > e.preventDefault(); >@@ -17,6 +18,6 @@ $(document).ready(function(){ > }); > $("#authorityDetail").on("hidden.bs.modal", function(){ > $("#authorityDetail .modal-body, #authorityDetail .modal-title").html(""); >- $("#authorityDetail .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /></div>"); >+ $("#authorityDetail .modal-body").html("<img src=\"" + template_path + "/img/spinner-small.gif\" alt=\"\" />"); > }); > }); >-- >2.30.2
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 34180
:
152918
|
152919
|
152979