Where is the FILEs list created when use din some modules to select pages that modules show

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Where is the FILEs list created when use din some modules to select pages that modules show

Post 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: Where is the FILEs list created when use din some modules to select pages that modules show

Post 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') . '&nbsp;' . TEXT_ALL;
I am not here to build for you.
I am here to build with you. Let's help each other.
raiwa
Certified Developer
Posts: 1641
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Where is the FILEs list created when use din some modules to select pages that modules show

Post by raiwa »

In an unmodified new core installation the page list shows already in alphabetic order.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Where is the FILEs list created when use din some modules to select pages that modules show

Post 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.
raiwa
Certified Developer
Posts: 1641
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Where is the FILEs list created when use din some modules to select pages that modules show

Post by raiwa »

Then Burt's sort addition may be a candidate for core optimization.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Where is the FILEs list created when use din some modules to select pages that modules show

Post 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.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Where is the FILEs list created when use din some modules to select pages that modules show

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply