SOLVED: ACF text field with single quote in it breaks when passed as an echo tag argument

Bricks v2-1-3 (can’t find a tag for it)

When I pass my ACF text field as an argument in an echo tag, I have the problem of the string breaking if there is a single quote in it.

Example echo tag: {echo:my_text_function(‘{acf_text_field}’)}
Example string: Everyone’s Going This Weekend

What the php function ends up with just “Everyone”, breaking at the first single quote. If I pass {post_title} instead with a quote in it, that works fine, so it’s specific to when I pass an ACF text field.

If I wrap the argument in double quotes, that doesn’t work at all (would be a good solution).

If I don’t wrap it at all, then the string ends up with missing spaces (is that expected behaviour?)

I need a way to pass ACF text values as arguments while preserving their single quote content.

Thanks

Hi @mindpattern,

That would be the correct approach (no wrapping with single quotes needed). But yes, I can replicate the issue with removed spaces, so it’s a bug.
I’ve created an internal task for this and we will update this topic once we release a fix.

Eventually, the wrapping with single quotes should also be supported, and I can see that wrapping with single quotes + a single quote inside the dynamic data is indeed an issue. But, we already have a report (internal task) for that.

Best regards,
Matej

1 Like

Hi,

I have been confronted with bug in my latest project (using Bricks Builder 2.3.3). For now, I have instructed my customer to use the HTML entity for single quotes to circumvent the problem, but do we have any insight on when a fix could make it into an upcoming update?

Thanks, much appreciated!

Hey @G00DSP33D,

sadly no. We were working on it quite a bit, but it’s quite tricky to solve it without introducing other issues, so it’s sadly not yet solved. :frowning:

Best regards,
Matej

Appreciate the transparency, we will share a cheat sheet with HTML entities with our customer :sweat_smile: thanks for the update though!

1 Like

That’s the way for now, until we figure this out. :+1:

We’ve addressed this in Bricks 2.4-beta (beta release), now available for manual download from your Bricks account.

Please read the changelog entry before testing, and let us know if you experience any issues. Note: beta builds are not recommended for production sites.

1 Like