Jump to content

PageTable doesn’t store re-ordering of items


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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By daniel_puehringer
      Hi community,

      I am using the "PageTable" Module (also called "ProFields: Page Table") and the built in "Language" Module (also called "Languages Support").

      With the help of PageTable I was able to create several content elements which should usually be displayed in German(default language) and English.

      However some Content Elements should only be shown in German and NOT in English.

      Well sounds easy, right? Not so fast. I really love this CMS, but I have not found a solution for this problem yet.
      As you can see in the screenshots attached I tried to uncheck the "active" Checkbox for the english language to completely hide the content element for english users.

      However no matter what I do the german text shows on the english page.
      If I leave the "content-should-not-be-shown-in-english"(see Screenshot Number 2) blank and save the page, the page will inherit the german page url "content-element-with-simple-text-which-should-only-be-shown-in-german".

      My question therefore is:
      How can I hide a specific content-element for only one language?

      I´m using the latest processwire & module versions.

      The code which I use to render the content elements looks like this:
      //Info: contentelements is a field of type "ProFields: Page Table" <?php foreach ($page->contentelements as $element): echo($element->render()); endforeach; ?> filename: basic-page.php

      I would really appreciate your help since I haven´t found a solution after reading through quite a lot of forum posts.

      All the best,

    • By LAPS
      I opened a new wishlist topic on the PW forum for this and in the meantime I ask to the community looking for a reasonable solution.
      Using the PageTable field, is there a way to un-restrict the creation of pages under a given parent template page (or as page children if no parent for items is selected)? That is, is there a way to allow the selection of the parent page dynamically / on the fly during page creation via the PageTable field?
    • By LAPS
      I'm using the PW PageTable field extensively and I think an improvement to it could be made regarding the ability to choose the page parent where the page created via PageTable will reside.
      Say you have a PageTable field set like this:
      Edit Field: page_table_field > Details >
      Select one or more templates for items
      > template_one
      > template_two
      > template_three
      Select a parent for items
      > parent_template
      Actually, you can only create pages under the parent_template page (or as page child if no parent for items is selected).
      BTW I am looking for reasons about this limitation.
      What about allowing to choose on the fly where the pages created via PageTable will reside? that is, having the possibility to choose dynamically under which parent page to create the pages?
      Actually, one could overcome to this by creating multiple appropriately set PageTable fields, one PageTable field per PageTable parent for items, but this is unsustainable (?) when you want to create a lot using PageTable…
      By allowing to choose dynamically / on the fly the parent page during page creation via the PageTable field would open up a wider usage of PageTable.
      What do you think about?
      @ryan @Robin S
    • By louisstephens
      So I ran into a very strange issue today. I have a template with a pagetable and I went to add an item to it, when I went to select an image (for an image field) the page instantly threw up an error
      "ProcessPageSearchLive: No search specified"
      The page's content also switched to the image attached. This all worked perfectly last week (local mamp box). Has anyone experienced this before, and how did you solve it?

    • By jploch
      Hey folks,
      I have a question regarding rendering of template files that are in a subfolder of the template folder.
      How would I for example render these PageTable items, when their template files are inside templates/blocks/:
      <div class="grid"> <?php foreach($page->grid_ext as $item): ?> <div id="pteg_<?= $item->id ?>"> <?php echo $item->render(); ?> </div> <?php endforeach; ?> </div> I tried this, but get an error:
      <?php echo $item->render(wire('config')->paths->templates . '/blocks/'); ?>  
  • Create New...