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

"Re-sort courses by name" in natural order

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.5, 2.3.2, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      Test pre-requisites

      1. Create a few courses named as followed (keep the order and case):
      • Course 10
      • course 2
      • course 11
      • Course 0
      • Course 1

      Test steps

      1. Navigate to Home ► Courses ► Courses ► Add/edit courses
      2. Browse the category you've created the course in
      3. Click on the button 'Re-sort courses by name'
      4. Make sure the order makes sense (from a human point of view)
      Show
      Test pre-requisites Create a few courses named as followed (keep the order and case): Course 10 course 2 course 11 Course 0 Course 1 Test steps Navigate to Home ► Courses ► Courses ► Add/edit courses Browse the category you've created the course in Click on the button 'Re-sort courses by name' Make sure the order makes sense (from a human point of view)
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-34765-master

      Description

      Moodle uses a very basic sortorder, provided by the DBMS. If you have e.g. the following courses:
      "Course 1", "Course 2", "Course 10", "Course 3" and press "Re-sort courses by name" on /course/category.php, you will get the courses in the following ("unnatural") order:

      "Course 1"
      "Course 10"
      "Course 2"
      "Course 3"

      Sorting should be done in PHP to improve the user experience.

      Replication steps:

      1. Create courses with numeric numbering similar to the list above
      2. Ensure that your site has more than one catagory
      3. Navigate to one of the courses
      4. In the breadcrumbs, click on the category name

      Expected result: Course names should be sorted in natural order

      Actual result: Course names are sorted in Unicode order.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Nov/12