Jump to content

Recommended Posts

Posted

happy new year to everybody! :)

what is wrong with my selector? or is this a bug? as soon as i add the has_parent statement it shows entries of 2016...

template=booking,created>1483225200,sort=-renr // works, timestamp = 1.1.2017
template=booking,has_parent=3643|5992|7537|7548|8409|8653|8664|8675|11126,created>1483225200,sort=-renr // does NOT work... shows entries of 2016

edit:

i can't reproduce this on another website... any hints what could be the reason?

Posted

I might be wrong but as I remember has_parent only works with one value.

Edit: the docs says

"Note however that at present, you can only specify one page at a time here (meaning no has_parent=1|2|3)."

  • Like 1
Posted

that is interesting because it works as expected and this does not seem to be the reason, because on another site it works also with has_parent=1|2

i solved it by adding an if statement ala

$lastBooking = $pages->findOne(...);

if($lastBooking->id AND date('Y', $lastBooking->created) == date('Y')) return $lastBooking->renr + 1;
else return 1;

but i would still be interested in the reason for the wrong result on my selector and why the docs say has_parent=1|2|3 does not work while it seems to work well in this case...

i hope someone knows the reason :)

Posted

thank you adrian, that is a good reason why it is working :)

@tpr no, exactly like pasted above created>12345

i guess if there is no obvious reason i would have to investigate further. but as i solved my problem in a different way i guess i will not have time for that at the moment :(

Posted

has_parent doesn't work (or at least not correctly) with OR pipes. The only way to make that work is with OR groups like so:
branch=(has_parent=1234), branch=(has_parent=1237)

 

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
  • Recently Browsing   0 members

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