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

Changing/removing CSS ID and CLASS selector names in theme layouts can silently break a variety of AJAX interactions.

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_23_STABLE

      Description

      There's a bunch of individual bugs about this, which I'll try to find and link to this one but:

      In Moodle Themes you have layout files that control the outer HTML of your site. If you change certain classnames then a variety of AJAX interactions throughout the site will silently fail.

      Some possible solutions to this issues:

      1. prominantly tell people that they aren't supposed to make any change the layout files in their theme.
      2. prominantly tell people that if they change anything in the layout file then they should fully test all javascript based functionality, as some of it may silently break.
      3. fully document all the dependencies so that themers can avoid accidentally breaking things.
      4. rewrite the javascript so that it doesn't silently fail, but clearly informs you that some expected classname was missing
      5. change the javascript so that it doesn't depend on anything that can be changed in the layout files.

      You need #page-header and #page-footer for PDF (etc.) embedding to work as intended.
      Hiding and showing activities via the eye icon on the course page can be broken too.
      The Activity chooser window that replaces the two drop downs will not become an active link unless the correct CSS is found.

      I personally would prefer some combination of the last two. I think most of the dependancies are attempts at optimisation that don't provide enough benefit to counterbalance the unexpected breakages as things change.

      I'll try to find the other bugs that document these in detail, but for an overview:

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              bawjaws David Scotson
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Bas Brands
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: