Steps to reproduce
1. Create an Activity with HTML entities in the name, such as:
2. Enable course's Completion Tracking and an activity's manual Activity Completion.
3. Hover over the activity's completion checkbox to see the title text with HTML entities.
For example, when hovering over its checkbox, an incomplete activity having the name from above will show with HTML entities. Note the single "&" is converted to &
If you then toggle the checkbox to Incomplete, it will still show with HTML entities as:
But notice that only the explicitly specified & stays encoded, while the last ampersand now displays correctly as a single "&", as it was originally in the activity name.
All strings with the activity name should always show with decoded HTML entities. In the example above, it should show as it does on the activity page itself:
- The text for the initial page load is handled by course_section_cm_completion() in /course/renderer.php. I imagine the fix might be to just add $imgalt = html_entity_decode($imgalt).
- However, subsequent clicks to toggle the completion checkbox on and off will go through /course/completion.js. The JS code will also need to decode the HTML entities, since it is pulling the activity name (module name) from the hidden <input name="modulename"> element.
- Similar issue: https://tracker.moodle.org/browse/MDL-59797