https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41580

--- Comment #35 from Paul Derscheid <[email protected]> ---
Created attachment 194979
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194979&action=edit
Bug 41580: (QA follow-up) Fix msg type coercion in upload alerts

- 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 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to