- Issue created by @weri
- 🇧🇪Belgium Jonne
We are experiencing the same. In my research I found that the computed field is indeed calculated but the problem lies in the fact that the conditions to show the field doesn't trigger visibility.
- 🇺🇸United States dswier
I recently ran into this issue in the process of testing our upgrade to D10.2. My use case is the very same as the initial post. We are calculating if the user is over 18, and if not we display the parent/guardian information fields. The logic in our computed twig field is slightly different, but the result is the same. Instead of saving a yes/no value, the value of our field was markup saying "Please provide the name of a Parent/Guardian". We had also been using the computed_twig field being "filled" as the condition for displaying the other fields. Just like OP, this stopped working between 9.5 and 10.2. In troubleshooting, I did also try checking for a value from the computed field, but that didn't work either. What I did see was that if my condition was the value being empty, the parent/guardian fields would always display. Therefore, my conclusion was that these computed fields don't seem to have a value that is available to the #states system anymore. We haven't found a workaround yet, but I don't have a full understanding of all the systems at work yet.
- 🇧🇪Belgium Jonne
I could resolve the issue this afternoon by updating my Drupal installation from 10.2.2 to 10.2.4. No related contrib modules received any updates in the process of updating everything, so I'm pretty sure this is related to a fix in core. I hope this helps the both of you.
- 🇺🇸United States dswier
Thanks for your comment, @Jonne! We were also on Drupal 10.2.2, so I updated, and that did indeed solve the issue for us.
- Status changed to Closed: outdated
8 months ago 6:33pm 12 March 2024 - 🇨🇭Switzerland weri
Thank you for all the feedbacks!
I can confirm that an update to core 10.2.4 solves the problem.