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

Alphabetise Groupings drop-down list

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.9.12, 2.1, 2.5.2
    • Fix Version/s: None
    • Component/s: Groups
    • Labels:
    • Testing Instructions:
      Hide

      Go into a course.
      Click "Groups."
      Click the "Groupings" tab.
      Create several groupings, being sure NOT to create them in alphabetical order.
      Go to the course page and create or edit a resource.
      Click the "Show Advanced" button.
      Check the "Grouping" drop-down menu; the groupings will be listed in the order in which you created them.

      Show
      Go into a course. Click "Groups." Click the "Groupings" tab. Create several groupings, being sure NOT to create them in alphabetical order. Go to the course page and create or edit a resource. Click the "Show Advanced" button. Check the "Grouping" drop-down menu; the groupings will be listed in the order in which you created them.
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_21_STABLE, MOODLE_25_STABLE

      Description

      When using the Groupings functionality in either 1.9 (restrict access to a resource or activity to a specific grouping) or 2.1 (apply the selected group mode to the groups in the selected grouping), the drop-down menu that lists the Groupings lists them in the order in which they were created. It would be fantastic if the groupings were displayed in alphabetical order.

      In 1.9 this is an easy fix: in course/modedit_form.php, at line 251, add the following line (surrounding lines shown for reference):

        if ($groupings = get_records('groupings', 'courseid', $COURSE->id)) {
      +     sort($groupings);   // ADD THIS LINE
            foreach ($groupings as $grouping) {
      

      This fix doesn't work in 2.1; I'll have to do some more poking through the code to see what's changed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              moodle.com moodle.com
              Reporter:
              carolinemoore Caroline Moore
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: