Jump to content

PageTable or Repeater fields added to an admin page are not saved correctly


Marc
 Share

Recommended Posts

I want to have a custom page under Settings in the admin that shows a PageTable field. I have it setup as follows:

  • Created a Process module that installs a page under /admin/settings. This page has the admin template and points to my module's process.
  • A page that has a template which holds the PageTable field. This page holds the children of the PageTable.
  • The execute function of the module renders a form that gets the inputfields from the page I mentionend above.

When I execute the module, a form is successfully rendered with the PageTable field. It looks like this:

pw-pagetable-1.JPG.0fac4a0d4183eac2d1575317af4f6dfe.JPG

However, after pressing 'Add New' and saving a new item, the form reloads and I see this:

pw-pagetable-2.JPG.5f7e99f240931ae024744ff179bb558d.JPG

The new item is saved but not listed in the field. I also tried this with a repeater field, which has a similar defect. Other types of fields like a text field work fine. When I add the PageTable field to the template of a regular page and edit that page, it works as expected. Only when accessing the field through my Process module's page it does not work correctly. I'm sure there's a fix for this. I think the form does not know what page to link the PageTable entries to perhaps?

Link to comment
Share on other sites

You cannot use a Repeater field in a Process module. I think a similar restriction might apply to PageTable fields.

It sound like your Process module is getting fields from another page, so maybe it would be better to simply edit that page in Page Edit? If you want a menu item to appear in the Setup menu you could create a Process module that redirects to Page Edit for a particular page, as @PWaddict shows in the post below:

 

  • Like 1
Link to comment
Share on other sites

15 hours ago, Robin S said:

If you want a menu item to appear in the Setup menu you could create a Process module that redirects to Page Edit for a particular page, as @PWaddict shows in the post below:

 

Thanks for pointing this out, that looks like an acceptable workaround.

  • 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...