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

Course format templates has an incorrectly named id.

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-78148-401
    • MDL-78148-master
    • Hide
      1. Create a course in topics format with a few activities and sections
      2. Go into the course as a teacher
      3. Open the browser inspector (by right click and inspect on something or with F11)
      4. Find in the elements inspector (using control+F)
        1. Search: ".course-content > div"
        2. Check the element has an Id like course-format-XXXX (where XXX is a combination of numbers and characters)
        3. Search: ".courseindex-item"
        4. Check all elements have an id starting with "course-index-cm-XX" or "courseindexsectionXX" (where XX is a number)
        5. Search: "#course-index"
        6. Check the element exists
        7. Search: ".courseindex-section"
        8. Check all elements has an id like "course-index-section-XX" (where XX is a number)
      Show
      Create a course in topics format with a few activities and sections Go into the course as a teacher Open the browser inspector (by right click and inspect on something or with F11) Find in the elements inspector (using control+F) Search: ".course-content > div" Check the element has an Id like course-format-XXXX (where XXX is a combination of numbers and characters) Search: ".courseindex-item" Check all elements have an id starting with "course-index-cm-XX" or "courseindexsectionXX" (where XX is a number) Search: "#course-index" Check the element exists Search: ".courseindex-section" Check all elements has an id like "course-index-section-XX" (where XX is a number)
    • HQ 2023 Planning i2 Moppies

      Many of the course format templates uses bad formatted element IDs.

      For example, in the file `/course/format/templates/local/courseindex/cm.mustache`

      the id name

      id="{{uniqid}}-course-index-cm-{{id}}"

      where uniqid can be 0
       
      according to the w3c spec for html, id's can not start with numbers. 
      https://www.w3.org/TR/2018/SPSD-html401-20180327/types.html#h-6.2
      this could possibly cause some issues with styling or element selection. etc.
      if uniqid is required, suggest use, 

      id="course-index-cm-{{uniqid}}-{{id}}"

      . instead, or just remove uniqid altogether.
       
       

        1. MDL-78148.png
          678 kB
          Ron Carl Alfon Yu

            tusefomal Ferran Recio
            pgee Peter Gee
            Mikel Martín Corrales Mikel Martín Corrales
            Amaia Anabitarte Amaia Anabitarte
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 41 minutes
                1d 3h 41m

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