Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, this is a wonderful piece into the Entities arsenal on Drupal! :-)
I'm trying to configure the visibility of a field based on a boolean field... but it doesn't work. There is no condition to select when using booleans. I guess it considers a boolena field with a value of "0" to have a value, because "Hide when target field is empty" is not working. And if I use "Hide when target field has an string" (comparing to "0") it doesn't work either.
Any idea?
Comments
Comment #1
swentel CreditAttribution: swentel commentedComment #2
JordiTR CreditAttribution: JordiTR commentedI have to say that after many months I've tried it again and it works!
I can't understand what happenned when I tried the first time. On the same site I've used "Hide when target field has an string" using "0" and "1" (which are the values that I'm using on that boolean field) and everything worked fine. Thanks!
Comment #3
JordiTR CreditAttribution: JordiTR commentedComment #4
knalstaaf CreditAttribution: knalstaaf commentedIt may be confusing or work with the "empty" options. Better is to use "contains a string" (e.g. "0") when it comes to booleans.
It's also possible that you have to re-save a node before you see it in effect.
Comment #5
rootworkWeirdly, I've discovered that this only works if the "string" you use is
0
or1
. That makes sense even if you change the values -- i.e. the "strings" you see displayed on the front-end -- to different values (say "Yes" and "No").I'm not sure if that's a bug strictly speaking, but it is a little confusing. Could this be documented?