This patch will add the option to sort files by alphabetical ordering rather than the default ordering.
Example is in the images below.

Comments

tomhung’s picture

Applied patch. Works for me.

Subscribing for integration into filedepot

ldav1s’s picture

A variable_del needs to be added in filedepot_uninstall() for filedepot_override_folderorder.

dizarter’s picture

Status: Needs review » Reviewed & tested by the community

Works as expected.

ldav1s’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.17 KB

Here's an updated patch with the variable_del.

vacilando’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

Works fine; please apply to the dev.

vacilando’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new5 KB

It does not work for files in subfolders.

I've uploaded a couple of files into a subfolder and they do not display in alphabetical order -- see the attachment.

ldav1s’s picture

I've duplicated this with the patch filedepot-alpha-file-order-2.patch. It seems to only happen when the option 'Display the index numbers in the listing of folders and files' is enabled.

ldav1s’s picture

Status: Needs work » Needs review
StatusFileSize
new6.45 KB

This patch should fix the problem in comment #6. I didn't understand the changes to filedepotAjaxServer_loadFileDetails in the original patch (the changes there should do nothing anyway, I hope), so I removed them from this patch.

vacilando’s picture

Was eager to try it, but unfortunately this patch fails against the current 6.x-1.x-dev. Could you please check and re-roll?

vacilando’s picture

StatusFileSize
new11.61 KB
new12.76 KB

Solved the patching temporarily by moving the module to folder "b" and then applied the patch.

However, looking at a subfolder, the files are not sorted by file names with or without "Display the index numbers..." option. See the attached screenshots.

ldav1s’s picture

Try "patch -p1 < issue-1263826-3.patch". I tried creating a folder with the same files you did and they are sorted for me.

vacilando’s picture

StatusFileSize
new12.69 KB

Thanks for the tip, yes, of course, that obviates the need for creating a temp folder.

The effect was the same, though. After applying the patch (and I did it again, very carefully, just now), and despite clearing all caches, despite trying in both the latest FF and Chrome, the files are not sorted by name and look the same
.
But that applies to an existing folder structure.

When I created a new folder with files, or a subfolder with the same files, they are ordered by file name even though I was uploading them deliberately in another order:

Is there something that prevents the existing structure to be re-ordered after applying the patch?

vacilando’s picture

Status: Needs review » Reviewed & tested by the community

The patch can definitely be applied now since it does work for freshly added files and folders.

vacilando’s picture

Bump... can somebody please apply the latest patch?

sharplesa’s picture

I'd change one thing from the posted patch at #comment-5491614. I'd change the default value from 1 to 0, as shown in the code snippet below:

@@ -108,6 +108,11 @@ function filedepot_admin_settings() {
   '#default_value' => variable_get('filedepot_show_index_enabled', 1),

to be

@@ -108,6 +108,11 @@ function filedepot_admin_settings() {
   '#default_value' => variable_get('filedepot_show_index_enabled', 0),

The reason is, when you first bring up the admin page with the first version set, it looks like you have already enabled alphabetical listing. By defaulting to off, users aren't accidentally misled. They *have* to click Save for the setting to take effect.

Of course, you could always add stuff in the .install to preset the file listing to alphabetical order, but then you're changing the default functionality away from what over a thousand users are already using and expecting.

If you agree, please re-roll the patch with the change described above.

_timpatrick’s picture

Updated dev - thanks for the patch. I had to modify it as the code structure has changed since it was made, but the general idea works.

_timpatrick’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Meant default ordering, not last modified ordering