SOLVED: No result if ACF Post Object (not multiple) query loop nested inside ACF Repeater

Strange thing that might be a bug, or it might me be not knowing what I’m doing. Here’s what’s going on:

I’ve got a ACF repeater with clone fields (the “sida” is in the repeater, the rest are clones, but I’ve tried this with a non-cloned fields and getting the same results):

I’ve filled SOME of the values in:

Now I’ve got a setup where I check if the repeater value is filled or empty. If it’s filled, I use the repeater value (this works fine). However, if it’s empty, I want to use the referenced post’s value as a fallback, that is, the post chosen in the first (“sida”) repeater field and returned in the query.

What I’m getting is the values from the post that the user is viewing, not the post in the query, but only the post title, the post contents (“ingress” and featured image) are left blank:

Here’s my setup in Bricks. The conditions are simply to direct which of the content blocks to show, the one with the fallback values, or the one with the values that are in the repeater fields.

Repeater Heading:

Heading fallback:

Repeater text:

Text fallback:

Button text and image works the same way, with similar fields.

All the fields are present in both the referenced pages (the ones in the repeater) and the page the viewer is viewing, however, only the post title is shown in the query results.

And here’s the query:

Let me know if you need anything else to figure out what’s wrong (or what I’m doing wrong).

Huge thanks in advance!

Browser: Firefox 124.0.2
OS: Windows
Bricks: 1.9.7.1

Hi @FilWi ,

If I understand correctly, you want to output (Fallback value in your case) the custom field belongs to the related “Post Object” defined in each repeater row.

Based on your setup, I don’t see you have a query loop for the Post Object field (puff-sida)
If you want to get the value from the post defined in puff-sida, you have to create a loop and choose this inside the Repeater loop.

I will mark this as “NO BUG”

Regards,
Jenn

1 Like

Thanks, Jenn, that makes a lot of sense!

However, when I try it, it results in nothing being shown:

From what I can see on the outside (and here, using a dummy heading containing plain text), the entire query loop block simply dies, yielding no results, no matter what query I use for it. Here’s the same thing, but with all the text blocks wrapped in the query, including the previously working ones:

It should be said that the fields stored in the repeater are clone fields, if that can be what’s wrong.

Hi @FilWi ,

Can you help to test if not using a clone field?
If a normal field doesn’t work, kindly send admin credentials to help@bricksbuilder.io and include this forum thread as a reference.
Let me know the template URL and frontend URL to that page as well.

Regards,
Jenn

Hey @itchycode

Sorry for the late reply; I changed the ACF fields while Bricks was active and suddenly all kinds of weird effects started happening (such as some pages ignoring their template rules, some changes not propagating to the outside etc.) So I’ve been recreating the setup from scratch in a clean wordpress install with no clone fields at all. :frowning:

But now I’ve gotten to this loop, and either I’m doing something wrong or the problem is something other than the clone fields. Here’s what I’ve got:

Here’s what it looks like on the outside:

The frames (styles) that contain the loop objects render just fine. However, the first loop result shows the basic text above the second query loop (the one returning a variable set in the main page), but only on the first result. Once the renderer goes into the loop, the loop seems to crash it, showing no results whatsoever, nor the basic text from the second loop (which should have been visible if it’s the inner loop that crashes, rather than the outer one.)

When I’m editing the template, the bricks editor repeatedly tries to render the contents, but it just fades slightly, then returns the empty results, ever rendering the preview. I’ve tried to capture what it does:

Here are the settings for the outer loop:

And the inner loop:

Thanks for the help and please let me know if you need anything else!

Best
/Filip

Hi @FilWi ,

May I know if your Post Object field only can choose 1 post (Select Multiple is not checked)

image

If so, that is a bug.

Regards,
Jenn

Hey @itchycode

Yep, Select Multiple is off. Sending an image of the entire setup in case something else is wrong:

Best
/Filip

i have exactly the same problem. as soon as the post_object is inside a repeater you don’t get any more results.
any official reply on this one?
thx for any help!

Hi guys,

We’ve fixed this issue in Bricks 1.9.8, (Bricks 1.9.8 Changelog – Bricks)).

Please let us know if you are still experiencing issues.

Regards,
Jenn

1 Like

Related - a condition based on a related post object doesnt seem to work. I have tried Is Empty, as well as != blank. Any ideas?