Bugzilla – Attachment 194738 Details for
Bug 41573
Tidy kohaTable block - patron_lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41573: (QA follow-up) Use var instead of const for dynamically loaded template
Bug-41573-QA-follow-up-Use-var-instead-of-const-fo.patch (text/plain), 3.17 KB, created by
Paul Derscheid
on 2026-03-06 14:36:51 UTC
(
hide
)
Description:
Bug 41573: (QA follow-up) Use var instead of const for dynamically loaded template
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2026-03-06 14:36:51 UTC
Size:
3.17 KB
patch
obsolete
>From 2cc036b5f7cb6b7c6ffbdc513e87e7fbc53a37dc Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Fri, 6 Mar 2026 14:19:44 +0100 >Subject: [PATCH] Bug 41573: (QA follow-up) Use var instead of const for > dynamically loaded template > >- patron-lists-tab.tt is loaded dynamically via jQuery .load() >- Using const for patron_id and cardnumber causes a redeclaration > error when the tab reloads after adding/removing a patron >- Change to var which allows redeclaration in the global scope > >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > .../en/modules/patron_lists/patron-lists-tab.tt | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >index 742df882683..46104acb714 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt >@@ -121,8 +121,8 @@ > </div> > [% END %] > <script> >- const patron_id = "[% borrowernumber | html %]"; >- const cardnumber = "[% cardnumber | html %]"; >+ var patron_id = "[% borrowernumber | html %]"; >+ var cardnumber = "[% cardnumber | html %]"; > addPermissions({ > CAN_user_tools_manage_patron_lists: [% CAN_user_tools_manage_patron_lists ? 1 : 0 | html %], > }); >@@ -134,22 +134,22 @@ > $("#table_listnopatron").kohaTable(patron_lists_dt_params); > $("#table_inlists").kohaTable(patron_lists_dt_params); > >- if (permissions.CAN_user_tools_manage_patron_lists){ >+ if (permissions.CAN_user_tools_manage_patron_lists) { > function addToList() { > var list_id = $("#add_to_patron_list_id_select").val(); >- $('#pat_lists_panel').text(_("Loading...")); >+ $("#pat_lists_panel").text(_("Loading...")); > $("body").css("cursor", "progress"); >- $('#pat_lists_panel').load(`/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=${patron_id}&patron_list_id=${list_id}&patrons_to_add=${cardnumber}`, function() { >+ $("#pat_lists_panel").load(`/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=${patron_id}&patron_list_id=${list_id}&patrons_to_add=${cardnumber}`, function () { > $("body").css("cursor", "default"); > }); > > return false; > } > >- function removeFromList( list_id, patron_list_patron_id ) { >- $('#pat_lists_panel').text(_("Loading...")); >+ function removeFromList(list_id, patron_list_patron_id) { >+ $("#pat_lists_panel").text(_("Loading...")); > $("body").css("cursor", "progress"); >- $('#pat_lists_panel').load(`/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=${patron_id}&patron_list_id=${list_id}&patrons_to_remove=${patron_list_patron_id}`, function() { >+ $("#pat_lists_panel").load(`/cgi-bin/koha/patron_lists/patron-lists-tab.pl?borrowernumber=${patron_id}&patron_list_id=${list_id}&patrons_to_remove=${patron_list_patron_id}`, function () { > $("body").css("cursor", "default"); > }); > >-- >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 41573
:
191139
|
191140
|
191141
|
191142
|
194733
|
194734
|
194735
|
194736
|
194737
|
194738
|
194746
|
194747
|
194748
|
194749
|
194750
|
194751