BUG: ACF + Accordion + Looper Provider (with Dynamic Content) = adds an extra comma at the end

When using a dynamic looper with ACF it adds an extra comma after the accordion content. I’ve included a screenshot of the stack to help determine the cause of this. Please let me know how we can patch this in the meantime, as this is on our live site. I’ll include a link in a secure note. Thanks.

Direct link to the image below in case it’s too small: https://tco-forum-uploads.s3.dualstack.us-east-1.amazonaws.com/original/3X/e/4/e408324d3a3762cccb242cf20666a1cb3d4bbe42.png

Just a friendly bump here. Curious what we can do to fix this before it’s patched in the theme itself. Thanks!

Hello Scott,

Thanks for writing in! Can you please clone your live site to a staging site so we can investigate the issue further? There could be a code somewhere in your child theme or a 3rd party plugin that is causing the issue. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Info requested attached as a secure note.

Hello,

The data in that particular accordion content is an object and I think you want to access answer_text which can be done through dot syntax below.

{{dc:looper:field key="answer.answer_text"}}

Something I wish was more accessible was using type="json" in dynamic content. It’s a relatively hidden feature and can be used like the below. You’ll notice you have a tag property as well, which looks to be unused causing the empty data after the ,.

{{dc:looper:field key="answer" type="json"}}

Have a great day!

Thanks, @charlie! This is exactly what we needed.

1 Like

Hey Scott,

You’re most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.