Bugzilla – Attachment 194979 Details for
Bug 41580
Tidy kohaTable block - tools
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41580: (QA follow-up) Fix msg type coercion in upload alerts
Bug-41580-QA-follow-up-Fix-msg-type-coercion-in-up.patch (text/plain), 1.90 KB, created by
Paul Derscheid
on 2026-03-09 08:49:57 UTC
(
hide
)
Description:
Bug 41580: (QA follow-up) Fix msg type coercion in upload alerts
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2026-03-09 08:49:57 UTC
Size:
1.90 KB
patch
obsolete
>From 6f2d4a32feb8fd179c53177dd77adb331e41fd27 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Fri, 6 Mar 2026 17:59:01 +0100 >Subject: [PATCH] Bug 41580: (QA follow-up) Fix msg type coercion in upload > alerts >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >- The tidy wrapped the msg variable in quotes, coercing a JS object > literal to a string which breaks ShowAlerts iteration over file > properties >- The original also used | html which would HTML-escape the JSON > quotes, a pre-existing bug >- Use | $raw with a TT IF guard, matching the codebase convention > for passing JSON from Perl to JS (e.g. TablesSettings) > >To test: >- Go to Administration â Authorized values â UPLOAD and create a > category >- Go to Tools â Upload, select the category, upload a file >- Search uploads by category to find the uploaded file >- Delete the file >- Verify the alert shows "<filename>: File has been deleted." >- Without the fix, the page shows "0: undefined, 1: undefined, ..." > because ShowAlerts iterates over character indices of a string > instead of properties of a JSON object > >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >index 2f12b0d95e4..13e29114ec7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >@@ -373,7 +373,7 @@ > addPrefs({ > OPACBaseURL: "[% Koha.Preference('OPACBaseURL') | html %]", > }); >- const msg_alert = "[% msg | html %]"; >+ const msg_alert = [% IF msg %][% msg | $raw %][% ELSE %]null[% END %]; > </script> > <script> > function StartUpload() { >-- >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 41580
:
191163
|
191164
|
191165
|
191166
|
191167
|
191168
|
191169
|
191170
|
191171
|
191697
|
191698
|
191699
|
191700
|
191701
|
191702
|
191703
|
191704
|
191705
|
191706
|
191707
|
194965
|
194966
|
194967
|
194968
|
194969
|
194970
|
194971
|
194972
|
194973
|
194974
|
194975
|
194976
|
194977
|
194978
|
194979