Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64199

HTML Entities Not Decoded in Activity Name for Manual Completion Checkbox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 3.5.3
    • Activity completion
    • MOODLE_35_STABLE

      Steps to reproduce
      ===============

      1. Create an Activity with HTML entities in the name, such as:

      A "Test" Activity & Perhaps More & Then Some

      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.

      Actual result
      ==========

      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 &

      Not complete: A "Test" Activity & Perhaps More & Then Some. Select to mark as complete.

      If you then toggle the checkbox to Incomplete, it will still show with HTML entities as:

      Completed: A "Test" Activity & Perhaps More & Then Some. Select to mark as not complete."

      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.

      Expected result
      ============

      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:

       A "Test" Activity & Perhaps More & Then Some

      Other points
      ==========

      • 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

       

       

        1. intial_page_load.jpg
          89 kB
          Nicholas Yang
        2. after_toggling_checkbox.jpg
          84 kB
          Nicholas Yang

            Unassigned Unassigned
            nyanginator Nicholas Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.