Double encoding of question bank categories in the category management drop marker

Description

Question bank categories with & < > " ' in their name do not get a correct drag and drop hover text in question bank category management.

TO REPRODUCE:
In https://qa.moodledemo.net/question/bank/managecategories/category.php?courseid=2 try to drag another question category into "Default for P&C Council" category so that it would create a new child category.

WHAT YOU EXPECT: The hover text is correct.
WHAT ACTUALLY HAPPENS: The hover text is double encoded.

Testing Instructions

Covered by Behat tests.

  1. In a course, in the question bank, create several categories and name one Category & < > " ' &amp;amp;. The already-escaped & is intentional.

  2. Verify the category is displayed as Category & < > " ' &amp;amp;.

  3. Drag a category over Category & < > " ' &amp;amp; to reveal the new child drop target [ + ].

  4. Drag the category to the new child drop target and hold it there.

  5. Verify the tooltip text "As a new child of Category & < > " ' &amp;amp; " is correct.

Workaround

None

Attachments

4

Activity

noreply
9 January 2025 at 14:38

Thanks for your contributions! This change is now available from the main moodle.git repository and will shortly be available on download.moodle.org.

Closing as fixed!

Kim Jared Lucas
8 January 2025 at 02:51
(edited)

The issue has been successfully tested and fixed in versions 4.5, and Main. Thank you!

2.

5.

Huong Nguyen
7 January 2025 at 02:21

Thanks, Luca for working on this issue.

It has now been integrated \o/
Integrated to main and 4.5 only.
Over to testing.

Tim Hunt
6 January 2025 at 14:45

Thanks . I think this is finally ready to go forwards

Follow the checks as defined in Moodle's peer review documentation

[y] Syntax
[y] Output
[-] Component library
[-] Icons
[y] Language
[y] Accessibility
[-] Databases
[-] Performance and Clustering
[y] Security
[-] Privacy (see Privacy API)
[-] The Moodle mobile app / web services
[-] Third party code
[y] Documentation
[y] Git
[y] Testing (instructions and automated tests)
[y] Overall completeness and correctness

noreply
19 December 2024 at 12:29

The main moodle.git repository has just been updated with the latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

TIA and ciao

Fixed

Details

Priority

Affects versions

Components

Labels

Assignee

Reporter

Peer reviewer

Integrator

Fix versions

Tester

Participants

Huong Nguyen
Kim Jared Lucas
Luca Bösch
Mark Johnson
noreply
Tim Hunt

Pull from Repository

Pull Main Diff URL

Pull Main Branch

Pull 4.5 Diff URL

Pull 4.5 Branch

Component Lead Review

Clockify

Created 26 August 2024 at 14:47
Updated 10 January 2025 at 19:15
Resolved 9 January 2025 at 14:38