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
Where is the FILEs list created when use din some modules to select pages that modules show
- burt
- Core Team
- Posts: 4561
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 413 times
Re: Where is the FILEs list created when use din some modules to select pages that modules show
/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.
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;I am not here to build for you.
I am here to build with you. Let's help each other.
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
- : Buy Me A Beverage
- 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
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
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
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
- : Buy Me A Beverage
- 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
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
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
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
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.