Mackski Posted May 9, 2018 Posted May 9, 2018 repeater->sort is returned with duplicate values for multiple entries, not sure how this can even happen. Has anyone experienced this before? I now have to set an index++ while looping though my repeater to set the sort order
wbmnfktr Posted May 9, 2018 Posted May 9, 2018 Can you provide examples/code that will help us to understand the problem and/or result. How many repeaters do you use? How do you call/query them? How do you want them sorted? I just tested it with 6 repeater items in a single page and get the results I expected. 1
Mackski Posted May 10, 2018 Author Posted May 10, 2018 In addition to this, I have repeaters with a page field reference. And only 1 in the repeater array does not provide a valid ID. This is super weird, because it's always worked until now. eg: for($page->dad_repeater as $r) { $ref = $r->child_page_ref; if(!$ref->id) die("Error, invalid page reference for repeater ".$r->id); } My code dies on this error, with a valid repeater id. When I check that repeater ID in Processwire, it has valid child_page_ref. Why will the child_page_ref->id return null when the child_page_ref is published, and selected in PW. * FIXED * Underlying code was setting the ID to -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