When JDownloads checks for new directories within its download area (and automatically creates corresponding categories), the helper method searchdir() within administrator/components/com_jdownloads/helpers/jdownloadshelper.php runs
natcasesort($dirlist)
so the directory list is nicely sorted.
Unfortunately, this has no real effect, as natcasesort preserves the key=>value association of the array, and all subsequent loops through $dirlist use keys 0..count($dirlist)-1.
Something like this (trivial) patch
--------------------
--- jdownloadshelper.php.orig 2016-05-10 22:02:05.529879084 +0000
+++ jdownloadshelper.php 2016-05-10 22:22:01.212591241 +0000
@@ -1898,7 +1898,8 @@
closedir ( $handle ) ;
}
if ( $d == 0 ) {
- natcasesort ( $dirlist ) ;
+ natcasesort($dirlist);
+ $dirlist = array_values($dirlist);
}
return ( $dirlist ) ;
}
--------------------
fixes this for me.
Thanks,
David
Hi David,
thanks for the fix. ;)