Jump to content

Unable to sort child pages within a top level parent.


simonds
 Share

Recommended Posts

First time using ProcessWire. As a developer I've been impressed so far.

Having trouble sorting a series of pages that are children of a top level page. I've tried sorting them from the Pages page (/admin/page/) as well as from the Children tab of the parent page. I watch the network traffic in Chrome and see that when I move one of the pages there is a POST to /admin/page/sort/ with form data that includes sort=

  1. . But when I reload either admin page, or reload the site page that lists them, the order is unchanged.

What am I missing here?

Thanks!

Link to comment
Share on other sites

Hi simonds,

As a developer you'll love ProcessWire :)

Hm sounds strange. Can you check if the template of the parent has a predefined setting for sorting the children?

This setting can also exist on the parent page itself under the "Children" tab, at the bottom.

Though Pw should give you a javascript message that the reordering isn't possible because the pages are sorted by field XY.

Which version of Pw? Any 3thparty modules installed?

Cheers

  • Like 1
Link to comment
Share on other sites

Wanze,

Thanks for the quick response.

In the template settings for the parent page, under Sort settings for children...Children are sorted by, None was selected. Changed to Manual drag-n-drop. Didn't have an effect.

Using PW 2.3.0. No 3rd party modules.

Link to comment
Share on other sites

This should be ok.

Can you set $config->debug = true; in /site/config.inc.php? In order to get any error messages.

I just looked at the Class that is handling the sorting: /wire/modules/ProcessPageSort.module.

Maybe you could check in the method sortPages if the query is getting executed?

Link to comment
Share on other sites

No error messages when I enable debug.

I've noticed that after I've drag-n-drop sorted the children the records in the db are in the correct order (SELECT ... ORDER BY sort). When I reload the Admin Pages page and expand the parent page the JSON that is returned does NOT have them sorted. Looks like they pretty much get returned in order of creation. Same thing when I do a $pages-get("/parent/")->children().

I thought I came across a thread here that mentioned something about drag-n-drop sorting only working for top level pages. Something about sorting a really long list of child pages with drag-n-drop being a bad thing as the reason.

Link to comment
Share on other sites

MySQL version is the problem! On our staging server, where the problem is happening, it is running 5.0.51. If I switch to my local install, running 5.5.24...success!

Curious to know what the specific bug in 5.0.51 is.

Thanks all.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...