File picker sort order for repositories

File picker sort order for repositories

by Loughborough College -
Number of replies: 2

Hi

I have an issue with the file picker in moodle 2, when we browse a file system repository the filenames within the folders aren't ordered by name, but the folder structure above seem to be ordered correctly.

I can't immediately see where I can change this, either in the code or moodle settings. Has anybody experienced the same issue before, and managed to fix it? (screenshot attached)

We are running Moodle 2.1 on a linux server with Mysql database

Attachment filesnotsorted.jpg
Average of ratings: Useful (1)
In reply to Loughborough College

Re: File picker sort order for repositories

by Loughborough College -

I managed to come up with a temporary solution of adding the line

sort($list['list']);

to the get_listing function in /repository/filesystem/lib.php (line 105)

this sorts the contents of the array of files before passing it back to the file picker.

Upgrading to a newer version of Moodle 2.1 soon, hope this has been fixed in subsequent updates.

 

Average of ratings: Useful (2)
In reply to Loughborough College

Re: File picker sort order for repositories

by John Ryan -

I'm using moodle 2.0.8 and found this very useful, though it only seems to sort sub folders.  The root level (for the course) is still not sorted.