Jump to content
Mackski

Repeater sort order duplicates

Recommended Posts

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 :(

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

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 😕

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...