lindquist Posted March 31, 2015 Share Posted March 31, 2015 Hi, I'm using a pagefield to hold a list of pages, and asmselect for input. The field holds the pages to show in the main navigation. however, the order of the pages is not saved, always reverting to the same order when I save. I can add and remove pages, it's the order that gets messed up :-/ any ideas? I'm using 2.5.24 and it's the same with PageListSelectMultiple .. best, tomas Link to comment Share on other sites More sharing options...
cstevensjr Posted March 31, 2015 Share Posted March 31, 2015 This is how it normally works Go to the parent page Edit the parent page Choose your sort order If this is not working please let us know 2 Link to comment Share on other sites More sharing options...
lindquist Posted April 1, 2015 Author Share Posted April 1, 2015 Sorry, I guess I was not clear. I have a field 'main_menu_pages', which is a Page fieldtype with the asmselect for input field type. I use this field in a "settings" page to specify the pages and order of entries in the main site navigation. the problem is that the order of the pages is not saved, but reverts when I save the "settings" page. now I've realised this, it works on my local "uniform server" where I develop. but it does not after I have uploaded to my testing host (for confirmation by the client before I replace her site). the selected pages are saved correctly, but the order is not. unfortunately I cannot log in to the hosting cpanel right now so I can't post versions etc from there. But I'm not sure how to go about debugging this. I can provide access if someone is interested in looking at it. Link to comment Share on other sites More sharing options...
cstevensjr Posted April 1, 2015 Share Posted April 1, 2015 Thanks for clarifying. now I've realised this, it works on my local "uniform server" where I develop. but it does not after I have uploaded to my testing host (for confirmation by the client before I replace her site). the selected pages are saved correctly, but the order is not. So your local development environment is a Windows based WAMP setup, correct? What versions of PW, PHP, MySQL and Windows? What OS, to include version numbers are on your online hosting solution? Link to comment Share on other sites More sharing options...
Macrura Posted April 1, 2015 Share Posted April 1, 2015 @lindquist - any console errors? Link to comment Share on other sites More sharing options...
lindquist Posted April 1, 2015 Author Share Posted April 1, 2015 I've not seen any errors :-/ Locally, I'm running "Uniform server" UniServer XI 11.7.2, php 5.4.39, mysql 5.5.42 My host is running 5.5.40-MariaDB-cll-lve , PHP 5.4.35 Link to comment Share on other sites More sharing options...
cstevensjr Posted April 1, 2015 Share Posted April 1, 2015 One thing to keep in mind, I believe there can be some differences (where sorting is involved) between MariaDB and MySQL. 1 Link to comment Share on other sites More sharing options...
lindquist Posted April 1, 2015 Author Share Posted April 1, 2015 The database looks to be updated correctly when I rearrange the pages and save, but it seems this order is not reflected when the field is loaded, both in admin, and in the frontend when I render the navigation. Link to comment Share on other sites More sharing options...
lindquist Posted April 1, 2015 Author Share Posted April 1, 2015 Just to make it 100% clear. This is my page field The page IDs are as follows: And the database is as expected: So far so good. Now I rearrange the pages, say I move "Kalender" to the top. Then save. In the admin, it looks like it didn't work, when the saved page is loaded again, the pages are ordered exactly as in the first image. With "Kalender" in the bottom, it does not help to reload the page. However, the database IS updated: But ... the frontend still receives the pages in the same order as in the admin. Effectively making me unable to sort. I'm not sure what to look at now, I've looked a bit at the FieldtypePage module, but it's a bit heavy for my PHP experience :-/ Link to comment Share on other sites More sharing options...
Wanze Posted April 1, 2015 Share Posted April 1, 2015 Hi lindquist, How is your selector to get the pages for the frontend? Do you order the pages by sort, e.g. add "sort=sort" in your selector. Link to comment Share on other sites More sharing options...
lindquist Posted April 1, 2015 Author Share Posted April 1, 2015 Hi, it's essentially these few lines in my template $settings = $pages->get('/site-indstillinger/'); $menu_pages = $settings->main_menu_pages; foreach ($menu_pages as $p) { // echo page links } Link to comment Share on other sites More sharing options...
Wanze Posted April 1, 2015 Share Posted April 1, 2015 Does it make any difference in your frontend if you try this: $menu_pages = $settings->main_menu_pages->sort("sort"); 1 Link to comment Share on other sites More sharing options...
lindquist Posted April 1, 2015 Author Share Posted April 1, 2015 Does it make any difference in your frontend if you try this: $menu_pages = $settings->main_menu_pages->sort("sort"); That does not make a difference Link to comment Share on other sites More sharing options...
adamspruijt Posted August 28, 2015 Share Posted August 28, 2015 I don't have any help to contribute, but unfortunately I have also been stuck with the issue for some time now (since at least 2.3). Still experiencing it (only on my remote host, not on local dev machine). Just thought I should add my two cents, maybe the issue isn't common but this also is not a one off. Link to comment Share on other sites More sharing options...
tpr Posted August 28, 2015 Share Posted August 28, 2015 Is any cache used? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now