Jump to content

PageTable doesn’t store re-ordering of items


isellsoap
 Share

Recommended Posts

PW: 2.7.3

User role: superuser

I have a page with a PageTable field. The field worked just fine, but suddenly when I re-order items in the PageTable on that page via drag and drop and hit save, the re-ordering doesn’t get saved and the old item order appears. Very odd …

The PageTable on all other pages with the same template work properly.

I tried to clone the problematic page, and tried to reproduce the problem, but I couldn’t on the cloned page! it works. I then deleted the original problematic page, and renamed the clone page to match the name of the original one (the cloned page had, of course, the "-1" suffix in the page name). After the renaming, the problem came back! So apparently my ProcessWire installation has a problem with the name of the problematic page (which is "/ueber-uns/" and "/about-us/" [it’s a multi-lingual setup], by the way, so nothing fancy).

I have no idea, how I can fix this issue, and I’m pretty nervous because the editors can’t change the appearance of the page due to this issue.

Link to comment
Share on other sites

I can't think of any reason why the page name would come into play for the sorting. What I would take a look at though is where your PageTable items are stored (common parent for all, vs. children of page being edited).

If using a common parent, look at the sort settings for that common parent on the Children tab, and make sure there isn't some predefined sort being applied. Likewise, look at the template used by that parent page and check the sort settings under the Family tab. 

If not using a common parent, then perform the same check as above, except for the page being edited (that page that contains the PageTable field). 

In your PageTable field settings, click the "Details" tab and review the "Sort fields" and make sure that it is blank. If it is blank already, go ahead and hit "save" anyway, just in case there's something caught in the field settings that needs to be refreshed. 

Link to comment
Share on other sites

Thanks for your response, Ryan.

I’m using a common parent for the PageTable items.

  • Sort setting on the page was blank, I changed that to "Manual drag and drop" and saved the page.
  • In the template of the common parent there was selected "None" in the children sorting setting. I changed that to "Manual drag-n-drop" and saved the template.
  • In the PageTable field there was nothing in the "Sort field" text field. I re-saved the field.

The problem still exists. Re-ordering items that are already part of the PageTable is not possible, also newly created items can’t get sorted (they can be only attached at the end of the list).

Again: this problem does not occur on other pages of the same template, with the same field, and thus with the same common parent. It seems to actually be only the mentioned problematic page in my first post. Also as written in my first post: cloning the problematic page, deleting the original one, and rename the cloned page to the name of the original problematic page, brings the problem back.

It’s absolutely weird.  :undecided:

Link to comment
Share on other sites

Oh my goodness, now it’s getting really weird. I narrowed the problem down.

I have a repeater field on said problematic page. I use the repeater to generate a subnavigation for the page in the front-end. The repeater field has a page field in it (called subnav_page). I have 4 or 5 repeater list items in total. When the page field in at least one repeater item points to the problematic page (in the case of the problematic page the page field of every repeater item must point to the problematic page [which is the one I am editing right now], because the subnavigation should only consist of anchors pointing to specific sections on the page in the front-end) than the ordering does not work, like described. If the page field of every repeater item points to any page except the problematic page, than the ordering works. I double and triple checked this. Also I checked, that the subnav_page page field is only used in the context of the repeater field, nowhere else. There is really no evident connection between the repeater field and the fields inside of the repeater field, and the PageTable field. But apparently, there is.

I have to take a break, this is just too weird …

  • Like 1
Link to comment
Share on other sites

Current status: I can reproduce this issue on two fresh installations (latest 2.7.3 and latest 3.0.8). But I made one more discovery that was missing to reproduce the issue: the page field inside of the repeater field must be declared as required, than you can reproduce the issue (this is also the case in the original problematic page described in my first post).

So, again, to reproduce this issue:

  • Create a repeater field, which has a page field inside (page field must be marked as required).
  • Create a pagetable field, allowing any template to be generated within it (like basic-page).
  • Add the two fields to a template (like basic-page).
  • Edit a page with the template basic-page.
  • Add two entries to the pagetable field and save the page.
  • Add a repeater item and select the current page in the page field.
  • Add another repeater item and select not the current page in the page field.
  • Save the page.
  • Try to change the order of the pagetable entries and hit save. 
  • The re-ordering should not work.

To get the ordering working:

  • Change the selected page of the first repeater item from the current page to another page.
  • Save the page.
  • Re-order the pagetable items and hit save.
  • Now the re-ordering should work.

I think I found a bug.

  • Like 2
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...