Jump to content

Page field type selectable pages & custom selector error


Mackski
 Share

Recommended Posts

I have a field setup as a Page type.

Custom selector to find selectable pages:
template=user, roles=rider

Users have the specified role, upon saving the page I get an error:
Error saving field "rider_account" - Page 1029 is not valid for rider_account (Page 1029 does not match findPagesSelector: template=user, roles=rider)

However, If I change the selector to: template=user it works (Although I get a full user list, not just those with role = rider)

Strangely this works if I use "Custom PHP code":
return $pages->find('template=user, roles=rider');

possible bug?

Link to comment
Share on other sites

5 hours ago, Mackski said:

Same error:
 Error saving field "rider_account" - Page 1029 is not valid for rider_account (Page 1029 does not match findPagesSelector: template=user, roles.name=rider)

I can confirm the same problem here although not sure why at the moment.

As a quick fix, I discovered that it works if you use this:

return $pages->find("template=user, roles=rider");

in the "Custom PHP code to find selectable pages" option instead.

Can you please check that works for you?

It would also be great if you'd consider posting an issue report about the custom selector option not working: https://github.com/processwire/processwire-issues

Link to comment
Share on other sites

3 minutes ago, Soma said:

You have to use the role Id instead of the name.

Yeah, that does work but it does seem weird that the selector using the roles "name" populates the select options properly but just won't save.

Link to comment
Share on other sites

6 minutes ago, Soma said:

You have to use the role Id instead of the name.

Same error:

Error saving field "rider_account" - Page 1029 is not valid for rider_account (Page 1029 does not match findPagesSelector: template=user, role.id=1015)

Error saving field "rider_account" - Page 1029 is not valid for rider_account (Page 1029 does not match findPagesSelector: template=user, roles.id=1015)

Link to comment
Share on other sites

  • 10 months later...

I'm still having problems with customer selectors to find selectable pages.

Specifically when trying to include unpublished pages, my custom selector is:

template=horse_profile,include=all

This selector only returns published pages, which is driving me nuts!

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...