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

Files added to a Folder do not sort in order if filename contains a number

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Files API, Resource
    • Labels:
    • Testing Instructions:
      Hide

      Test pre-requisites

      • A folder with files (play with names, or use the zip)
      • Contains a new upgrade query, should be tested against all 4 DB engines (for 2.3 and master)
      • Do NOT upgrade yet!

      Test for 2.2

      1. Create a file resource and add a file named '0.txt'
      2. Set the file as 'main file'
      3. Go to your folder, edit and click to add a file
      4. Browse the server files repository to pick the file you added in the file resource
      5. Save
      6. Make sure files are displayed in correct order

      Test for 2.3 and master

      1. Before upgrading your instance, hack your database to set a sortorder of 1 for some files in your folder resource.
      2. Upgrade and make sure all sortorder have been set to 0
      3. Go to your folder and make sure the file order is correct
      Show
      Test pre-requisites A folder with files (play with names, or use the zip) Contains a new upgrade query, should be tested against all 4 DB engines (for 2.3 and master) Do NOT upgrade yet! Test for 2.2 Create a file resource and add a file named '0.txt' Set the file as 'main file' Go to your folder, edit and click to add a file Browse the server files repository to pick the file you added in the file resource Save Make sure files are displayed in correct order Test for 2.3 and master Before upgrading your instance, hack your database to set a sortorder of 1 for some files in your folder resource. Upgrade and make sure all sortorder have been set to 0 Go to your folder and make sure the file order is correct
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-34607-master

      Description

      Would like to see files sort in order if numbers are added to the beginning of the file name. Currently they only show in order if editing mode is on. Please see screen shots attached.

      Replication steps:

      1. Create a folder in your course.
      2. Choose to add files to the folder. Make sure the file names begin with a number.

      In editing mode the files appear sorted correctly by the number in their name.

      Once editing is off the files no longer are sorted by the number in their name.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

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