SOLVED: Dynamic data calls to ACF relationship field no longer works

I have a query loop which pulls in the value of an ACF relationship field (“associated region”) into each card in the grid. Up to v.1.7 it worked fine, and the field value would appear on each card (the value in parentheses):

In v.1.7.1 the value is no longer retrieved. This is how the cards look:

Page in question is Things to Do - Okanagan.com. Note that I have downgraded to 1.7 to get it working again.

Not confirming anything but this looks similar to other ACF relationship field reported behaviors. Search the bug topic - fairly certain its a WIP. Good report though!

The weird thing is I DID search for other reports of something like this. Even just using the term “relationship” only finds posts from last November (one of which is mine!)

Hi

I am using an acf relationship field in a single template for a custom post type. The acf relationship field return format is set to object.

It works without any problems in 1.7.1.

So it might be a problem with an acf relationship field within a loop.

Cheers

Patric

Hi Eric,
Thanks so much for your report!

Unfortunately, I cannot reproduce the issue. Can you please test it again with Bricks 1.7.2, which will be released soon? If it still doesn’t work, please send us access data and a link to this thread to help@bricksbuilder.io.

There are currently no other reports on the topic of “ACF Relationship”.

Best regards,
timmse

My mistake (was a late night yesterday): this was the one I was referring to: NO BUG: ACF Relationship

OK, I’ll try when 1.7.2 is out. However note that your forum search function is not working. Searching for keyword “relationship” does not find the post @FranklyCo mentioned, NO BUG: ACF Relationship

It is working :wink:

No it’s not:

You just have to click on the More… link at the bottom to see all the results.

In the quick search, the posts are displayed according to relevance (default). The post mentioned has no relevance because its content only consists of the error message.

However, you can always search in more detail if you want, or even sort by date. Then you will see the most recent posts first, as in my screenshot.

I have tested with 1.7.2. Same problem as with 1.7.1. I will email a login for the site.

Hi Eric,

As per my reply in the email.

Please use the query loop to output ACF relationship field

Your previous setup:
image

Correct setup:

Regards,
Jenn

1 Like

This is the exact opposite of intuitive—I mean could one expect to put a query loop inside another query loop for extracting a single value (i.e. no looping!)? In any event, it does work. But the old method (up to 1.7.0) was far easier and more intuitive.

Hi Eric,

My apologies, yes you are right, you should be able to use {acf_associated_region} directly to retrieve the data directly. I am able to do that locally without issue in the latest 1.7.2 version.

If the Return Format of the relationship field is Post Object, it should render the post’s title wrapped into a link.
If Return Format is Post ID, it should render the post’s ID directly.

Let me check your staging site again and it could be some other issues causing your website not working.

Regards,
Jenn

Hi! Off-topic question. And how did you make this menu with icons for quick switching? Can you share this? Thank you!

Hey Roman, it‘s BuilderAddon:
https://builderaddon.com/bricks/

1 Like

Hi @ainom ,

After the investigation, found that you have the same field name “associated_region” in 2 different field groups.

There is a bug in Bricks that misread the incorrect field settings if the same field name exists in ACF.
I have recorded this into the bug tracker.

For the time being, you could still use it as long as both Return formats are the same.
If there is no specific reason to restrict the return format as ID or Post Object inside both Field groups, I would suggest setting it as Post Object (default) for both.

Once set, you will get the value as expected.

Regards,
Jenn

1 Like

So does this mean that as long as both fields are set to return “Post Object” I can then return to looking up the data without a needing query loop inside the main query loop?

@ainom: Yes. This should be the case.