ACF Looper Broken in Pro (v6.7.3)

This morning I logged in and realized a good number of our pages were broken due to an error with ACF Looper and the latest version of Pro (v6.7.3). I recently did an update from 6.6.9 → 6.7.3 and now have to revert to an older version to fix this on our production site due to this overlooked issue.

I will include login details for our DEV site in a secure note, but here are the details what is happening (in case someone else has this issue, too):

In ACF, we have a field group which is active based on a specific Page Template:

This is the setup for the field group:

This is what that same setup actually looks like inside of our Edit Page view on these specific pages:
image

Inside of Cornerstone, this image is being loaded in as a Background Image with {{dc:acf:post_field field="banner__banner_image"}} (which has always worked, by the way, even with Twig enabled, which we needed to enable for a niche situation just a couple of weeks ago).

My guess is there’s something conflicting with the new update (I’d put money on Twig or something there, I’ll explain in a sec) because here’s what the banner looks like before and after updating to v6.7.3:

On v6.6.9:

After updating to v6.7.3:


(btw, this was the ONLY thing changed, we double-checked via test environment)

We are forced to downgrade, which wasn’t easy… as we had to restore a previous version of the site and siphon it from that to reupload it to live. I really think there should be previous versions to easily download, maybe there are and I’m just missing it.

Anyway, the reason I think it might have to do with the Twig integration potentially… is because when I went to double-check via clicking the Database (:oil_drum: icon in the textbox for the Image URL under Background Layers - see screenshot below)…
image
… it shows some weird syntax of {{ acf.post_field({"field":"banner__banner_image"}) }} instead of {{dc:acf:post_field field="banner__banner_image"}}… is this new syntax that we suddenly have to adjust everything to? Because even when I select it, it still doesn’t work. This is why I think it may have something to do with Twig especially based on this post & comment (Problems with upgrade to Pro 7.1/Cornerstone 7.7 and loopers on acf repeaters) - and I’m not sure if it’s the same issue, but even after upgrading, it isn’t fixed on my end.

Which page on your staging site has the issue?

@charlie - updated the secure note to include that info

1 Like

Okay thanks for the info. It has to do with using “Image Array” as an ACF return type. If possible you can use “Image ID” to fix that. We’ll get a fix for this in 6.7.4 as well. Have a great day.

Thanks @charlie - much appreciated, as always.
Two quick follow-up questions, please:

  1. is there a way to continue to use Image Array and adjust the dynamic content text tag to get it to return just the ID? I’ve seen this method before (something like type="ID" or… something?)

  2. Still curious on the “new” syntax that seems to be populating when clicking the dynamic content icon and loading in the tag that way. For example, my current tag is {{dc:acf:post_field field="banner__banner_image"}} but when adding it via the DB icon it gives {{ acf.post_field({"field":"banner__banner_image"}) }}… so I just wanted to be sure…
    a) both were ok to use
    b) or if we should be using one over the other?

Thanks again

oh, and, the obvious question, when is 6.7.4 expected to drop to patch these things? :slight_smile:

1 Like
  1. There is however I think because you’re using an ACF group value it didn’t work for me. It would be {{dc:acf:post_field field="banner__banner_image" type="object" key="ID"}} [1]

  2. You have Twig enabled so that’s why you would be seeing that. The only place you can’t use Twig is the Dynamic Content Looper, when you press the DC button in that control it actually doesn’t give you Twig. You can do more with Twig and there’s a minimal performance gain if caching is enabled, but both are okay to use.

We need to test the fix more, but hopefully we can release that next week or the week after.

[1] https://theme.co/docs/dynamic-content#formatting