Jump to content

Hidden referenced pages not found with subfield selector


Soma
 Share

Recommended Posts

When I have a page field that is dereferenced as single, and the pages to select from are hidden the following selector doesn't return matches. If the page is not hidden it works. Also when not using subfield selector it works even with hidden pages. No, include=hidden doesn't make a difference.

I know one could make the parent of the selectable pages hidden instead, just thought I mention it.

Example code



$pages->find("template=basic-page, select_page.title=foo");


If the "foo" page is hidden it doesn't find the pages.

Link to comment
Share on other sites

Soma, that's a good find. I'm pretty sure I know why this is the case. Right now when it executes a match on other pages, it doesn't specify an "include" setting, meaning pages can be excluded. It probably should not be that way. I know where to make the change to fix it (it will be easy), but the question I'm struggling with is whether it should be "include=all" always for subfields? After all, we're not technically matching the pages the subfields live on, just the page that references them. It seems to me like it should always be include=all, but I also worry if I'm not thinking through all possible side effects. 

Link to comment
Share on other sites

  • 4 years later...

Just ran into this issue today. It seems like the subfield should disregard access settings since you are not actually getting the subfield, but are only checking for its relationship to the page you are getting. I see that there is still a todo note about this in FieldtypePage.module

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