Page 1 of 1
Where is the FILEs list created when use din some modules to select pages that modules show
Posted: Sun Sep 10, 2023 3:35 pm
by 14Steve14
I am having a problem where on modules where pages can be selected that the file order is not alphabetically. Can anyone tell me where this is created please as I cant find anything so have no idea where to look.
I have attached an image to show what is happening
holiday-message-page-list.png
Re: Where is the FILEs list created when use din some modules to select pages that modules show
Posted: Sun Sep 10, 2023 8:19 pm
by burt
/includes/system/versioned/1.0.5.6/page_selection.php outputs the list.
The chosen pages are stored in the database in the module settings.
Sounds like you need to sort the files after the construction of the list but before they are output.
Over ride the above file, eg by dropping a copy in /includes/system/override/ (create this folder if needed) and add a sort.
Code: Select all
$files = array_unique($files);
sort($files); // new line of code
$output = Config::select_multiple($files, $values, $key) . '<br>'
. new Tickable('p_all', ['class' => ' '], 'checkbox') . ' ' . TEXT_ALL;
Re: Where is the FILEs list created when use din some modules to select pages that modules show
Posted: Sun Sep 10, 2023 9:34 pm
by raiwa
In an unmodified new core installation the page list shows already in alphabetic order.
Re: Where is the FILEs list created when use din some modules to select pages that modules show
Posted: Sun Sep 10, 2023 11:56 pm
by ecartz
raiwa wrote: ↑Sun Sep 10, 2023 9:34 pm
In an unmodified new core installation the page list shows already in alphabetic order.
That may be a file system specific behavior. I.e. some file systems may show it alphabetically by default while others have some other order. The DirectoryIterator just takes whatever the file system gives it.
Re: Where is the FILEs list created when use din some modules to select pages that modules show
Posted: Mon Sep 11, 2023 11:31 am
by raiwa
Then Burt's sort addition may be a candidate for core optimization.
Re: Where is the FILEs list created when use din some modules to select pages that modules show
Posted: Mon Sep 11, 2023 12:18 pm
by 14Steve14
raiwa wrote: ↑Mon Sep 11, 2023 11:31 am
Then Burt's sort addition may be a candidate for core optimization.
I was thinking the same and did also think about adding this to the bug find thing that is currently running, but not sure if its a bug though as it may not affect everyone.
Re: Where is the FILEs list created when use din some modules to select pages that modules show
Posted: Tue Sep 12, 2023 10:12 am
by 14Steve14
Brilliant. Another job crossed off the very long To Do list before starting on transferring the database across to a new look site. I am sure there will be other questions as I go along.