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

Perform natural sort on groups and groupings

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 1.9.9, 2.0, 3.0.8, 3.2.3
    • Groups
    • MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_30_STABLE, MOODLE_32_STABLE

      Groups and groupings are currently sorted using a basic alphanumeric sort (as the sorting is done by the DBMS), which fails to sort names with numbers in them correctly when the number of digits differs. For example, if you use the auto-create groups feature to create 20 groups using the naming scheme "Group #" it'll create "Group 1" through "Group 20" - but they'll appear in lists in the order "Group 1, Group 10, Group 11, ..., Group 19, Group 2, Group 20, Group 3, ..." which isn't ideal.

      I've attached patches against Moodle 1.9.9 and Moodle 2.0 (cvshead from git.moodle.org/moodle.git) which implement natural sorting on groups and groupings. I may have missed any places that they're listed outside the groups/groupings admin area, as I haven't done an exhaustive search of Moodle for lists of groups/groupings).

      Note that you won't be able to get to the Groupings or Overview tabs on 2.0 until MDL-22903 is resolved (unless you manually patch it), and that the list of groups assigned to the selected member in the group assignment list will not appear on 2.0 until MDL-22935 is resolved. These features will all still be sorted correctly by the attached patch.

            moodle.com Moodle HQ
            paul.n Paul Nicholls (Inactive)
            Votes:
            14 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

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