cpx3 Posted April 29, 2024 Posted April 29, 2024 I have the following selector: $ps = wire("pages")->find("parent=/veranstaltungen/, !promo_start_date>$time, !promo_end_date<$time, limit=3, sort=start_date"); that works perfectly. But when I add pages from another query with $a->add() function, the two page arrays seem to get sorted separatedly when I sort them with $array->sort(), but I need the whole array to be sorted... Any ideas what I am doing wrong?
cwsoft Posted April 29, 2024 Posted April 29, 2024 Please check if you have a page item added twice in your PageArray after the add operation. Had a similar issue with sorting in one of my projects due to one page item added twice as result of an add call. Just output the PageArray e.g. with Tracy dump methods for a quick check. If there are duplicated page items, PageArray is sorted by page ids by default. See this thread for additional infos. 1
cpx3 Posted April 29, 2024 Author Posted April 29, 2024 A million thanks, that was indeed the problem. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now