Hi,
We encountered a strange problem regarding the selector behaviour in find()/children().
Background information:
Our page setup regarding the templates/fields that go wrong is as follows:
Please note that both faq-category and faq-detail are hidden pages, due to the fact that we only wish to display them on faq-overview, not any where else.
What's happening:
We are using the following selectors to load the faq-categories and within the faq-detail pages.
$page->children->find("template=faq-category, include=hidden")
Then, for each child of that result, we use the following code:
$questionCat->children->find("template=faq-detail, include=hidden")
Results from both selector queries are 0 results. If we only use template=faq-category, 14 results (of the 18 pages, a few are unpublished, a few are hidden).
If we use the code above, or any variation on it, zero results. None of these work:
$page->children->find("template=faq-category, include=hidden")
$page->children->find("template=faq-category, include=all")
$page->children->find("template=faq-category, status=hidden|published")
And now for the strangest part (because I could've just done it wrong, couldn't I):
The following code dóes work and returns 16 results (the 14 published ones, 2 hidden ones, and the 2 unpublished ones aren't included, as should be):
$pages->find("template=faq-category, status=hidden|published, parent=" . $page->id)
$pages->find("template=faq-detail, status=hidden|published, parent=" . $questionCat->id)
If anyone is able to give us any insight as of why this is happening and whether it's because we made a mistake (or it's a bug in ProcessWire? Can't imagine but... you never know), that would be great!