Jump to content

Problem with custom php selector in pagefield


Orkun
 Share

Recommended Posts

Hi Guys

I have a pagefield called footer which has this code:

return $page->find('');

As for as I know, this should return all descendants of the corresponding page. Now I am using this field on template called domain_root. I have many domain_root pages with some descendants. But one of these domain_roots are just returning the first level of children or. direct childrens. But all the other domain_roots are returning all descendants. I don't know why this is happening. Do you have some ideas what could cause this?

All descendants are published, all langstatuses of all descendants are active, access for all descendants are inherited by the domain_root page. All covered up (I think).

 

Greetings Nukro

Link to comment
Share on other sites

14 minutes ago, LostKobrakai said:

I'd suggest using this (at least more descriptive version) and see if it fixes things:


return $pages->find("has_parent=$page");

 

Still the same. But I have found out something. The grandchilds that I am not getting are living under the child "jobs". When I add another grandchild to another child inside the domain_root I get it in the pagefield. Looks like it has something to do with the "jobs" page or so... 

Link to comment
Share on other sites

Hmm ok. So should I try your mysql script to reorder the descendants of the domain root? When I move the grandchildren out of the child I get this error:

Bildschirmfoto 2017-01-12 um 14.32.02.png

What does your script exactly do? Reorder all pages under home?

Edit: 36093 is the id of the domain root. Looks like moving childs of domain root returns this error but moving grandchilds returns no error -> This error comes from a different hook of mine, so has nothing to do with the problem itself.

PS: I am using 2.7.3 Version

Link to comment
Share on other sites

On 12.1.2017 at 3:27 PM, LostKobrakai said:

It does not reorder, but it does detect missing page/parent pairs in the pages_parents table.

Ok I see. I think this bug will not be fixed in the future, since Processwire 2.7.3 is legacy? For the moment It looks like you can fix it, when you moving the pages out of the current branch and then move it back (this helped for my case). Perhaps I need to upgrade the site to the 3.v branch since Ryan mentioned, that this behavior should already be fixed in the 3.v Branch. Thanks for your Time @LostKobrakai.

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