Moodle
  1. Moodle
  2. MDL-21009

Group selector does not work without JavaScript in some modules

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Accessibility
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      31836

      Description

      Reported modules are:

      forum
      chat
      database

      (plus in contrib, forumng)

      The problem is that these modules use relative paths for the group selector. This does not work if JavaScript is not used. There are two possible fixes:

      a) Change the script to use referer and apply relative paths
      b) Change all the modules to use absolute paths

      I prefer option (b) because referer information is not guaranteed to be reliable (and if we are in odd case with non-JS then maybe we are in odd case with referer). As an addition, I also think that the function should give a developer debug warning if a relative URL is passed.

        Activity

        Hide
        Sam Marshall added a comment -

        note this does not work in 2.x at all at the moment - however I will try to make the same change and either leave it no more broken than it already is, or else actually fix it (probably the former though).

        Show
        Sam Marshall added a comment - note this does not work in 2.x at all at the moment - however I will try to make the same change and either leave it no more broken than it already is, or else actually fix it (probably the former though).
        Hide
        Sam Marshall added a comment -

        I did a search and corrected all instances, checking each one to make sure $CFG was available in that context (it always was, actually). I added the safety DEBUG_DEVELOPER check into grouplib as described. I tested most instances in 1.9 stable, but may have missed something.

        In HEAD I did another search to find more instances (where my patch didn't apply). I did not check most instances in HEAD, only one sample. Note that in HEAD, group selectors should really be printed using $OUTPUT not the old function, however I did not fix this - just applied the same fix I did to 1.9.

        As far as I'm aware, group selectors now do work with JavaScript turned off!

        Show
        Sam Marshall added a comment - I did a search and corrected all instances, checking each one to make sure $CFG was available in that context (it always was, actually). I added the safety DEBUG_DEVELOPER check into grouplib as described. I tested most instances in 1.9 stable, but may have missed something. In HEAD I did another search to find more instances (where my patch didn't apply). I did not check most instances in HEAD, only one sample. Note that in HEAD, group selectors should really be printed using $OUTPUT not the old function, however I did not fix this - just applied the same fix I did to 1.9. As far as I'm aware, group selectors now do work with JavaScript turned off!
        Hide
        Andrew Davis added a comment -

        Closing. I was able to replicate the error and that this fix does indeed fix it. Adding a check within groups_print_activity_menu() for absolute URLs was a good idea.

        Show
        Andrew Davis added a comment - Closing. I was able to replicate the error and that this fix does indeed fix it. Adding a check within groups_print_activity_menu() for absolute URLs was a good idea.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: