SOLVED: Condition for ACF true / false field does not work anymore with ":value" and 0 / 1 in v1.8.4

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.

Hi

after upgrading my staging site to Bricks v1.8.4, the conditions that I use to check for an ACF true/false field do not work anymore.

Before in v1.8.3, this condition worked:

Now in v.1.8.4 to make the condition work again, I have to change the condition to this (without the :value and with True / False spelled out instead of simply 1 / 0):

Cond2

Was the logic changed in v.1.8.4?

Thanks and best regards

Patric

2 Likes

Hey @Patric,

thanks for your report.

I was able to reproduce the issue and added it to our bug tracker. Sorry for the inconvenience.

Best,

André

3 Likes

Can you tell me if this problem has already been solved? This logic doesn’t work for me either.

Yes, it works for me.

But I have changed all my conditions to True / False.

So I can’t say if something else has changed.

Doesn’t work for me currently.

Hi Ales,
Thank you for bringing this thread up again. We seem to have forgotten to mark it as solved (Bricks 1.8.5).

What exactly is your problem and how can I reproduce it?

Hi, thanks for the reply. I tried every option to call the true/false field:

{field}
{echo:field}
{field:value}

I have found, that only {field} works. However, it returns the True/False translated to site language which is strange, but why not.

I expect {field:value} return 0 or 1 because what if customer change the site language when using {field} in Bricks? It stop working then because it will need to translate the True/False in condition again?

Best regards, Aleš

Hi Ales,
{field:value} works fine in my test and returns either 0 or 1. I can’t give you a general answer as to why this is not the case for you.

Would you be so kind as to send temporary login credentials, information on where the true false field is located, and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?

I tried it too at other site, and doesnt work. I will contact the support. Maybe the stylized UI with true/false field changes something…


Hey Ales,
I have checked with the developers. Let me summarize:

{acf_truefalse_field} returns the label that is either True or False, and yes, the labels get localized (translated) when changing the WP language. That’s why it’s not a good idea to use the label within conditions. We have just updated the Academy accordingly: Dynamic Data – Bricks Academy

{acf_truefalse_field:value} returns 1 if true, nothing/empty if false on the canvas/front end - and that’s where it gets confusing, but that’s the way PHP works in this case. You will get the same result if you output the field with the_field('acf_truefalse_field') in pure PHP (in a code block).

However, you can still (and should) compare within conditions against 1 or 0 (see link above).

PS: Have you sent us access data yet? As far as I can see, nothing has arrived yet - or ended up in spam.

Hello, I did not yet I have big troubles after updating Automatic.css on my websites so I am working on them. However I used PHP to be sure that condition will work, same as you mentioned and its fine for me. Thanks!

Hi Ales,

We’ve added some improvements in Bricks 1.9.9 beta, now available as a manual download in your account (see changelog), which should prevent the problem.

Please let us know if you are still experiencing issues.

As with any beta release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment.