- 🇫🇮Finland heikkiy Oulu
I tested this with the latest 4.0.0 release. Patch applies cleanly the field formatter seems to work fine.
I tested patch #3 with Drupal 10.1.4 and cshs 4.0 and I am getting this error:
AssertionError: assert(!\array_key_exists($element['#none_value'], $element['#options'])) in assert() (line 64 of modules/contrib/cshs/src/Element/CshsElement.php)
I get the error when I try to add a condition between two fields , field 1: Document Type ( cshs ) and Field 2: Lab Document Type ( Select list )
The condition I am trying to set is that if field 1 has the value of option: Laboratories , show Lab Document Type fieldI was able to fix the assertion error by checking if the key specified by $element['#none_value'] exists in the array $element['#options']. If it doesn't exist, the code inside the if block will be executed.
Added this to line 64 to cshs/src/Element/CshsElement.php file
if (!array_key_exists($element['#none_value'], $element['#options'])) { // Make sure the `#none_value` doesn't overlap with other keys. \assert(!\array_key_exists($element['#none_value'], $element['#options'])); // Make sure the `_none` option is added very at the beginning of a list. }
- Status changed to Needs work
about 1 year ago 3:48am 22 October 2023 - 🇮🇳India sarathkm kerala
Facing issue with AssertionError: assert(!\array_key_exists($element['#none_value'], $element['#options'])) in assert() (line 64 of /var/www/html/web/modules/contrib/cshs/src/Element/CshsElement.php)
- Assigned to sarathkm
- @sarathkm opened merge request.
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 4:46am 22 October 2023 - last update
about 1 year ago 15 pass - last update
about 1 year ago 15 pass - @sarathkm opened merge request.
- last update
about 1 year ago 15 pass - last update
about 1 year ago 15 pass - 🇬🇧United Kingdom danharper
I'm facing this issue using the field_states_ui module.
The showing and hiding just doesn't seem to work even with the latest patch.
- 🇨🇦Canada joseph.olstad
@danharper, you'll want to rebuild cache after applying any patch.
-
joseph.olstad →
committed c56e63aa on 4.0.x
Issue #3150700 by sarathkm, kerasai, HeikkiY, mayela: Conditional Fields...
-
joseph.olstad →
committed c56e63aa on 4.0.x
- Status changed to Fixed
9 months ago 2:09am 10 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- 🇮🇳India sarathkm kerala
Hi @joseph.olstad,
I am not sure why, but I don't see this Issue credit being added to any of the contributor.
- 🇨🇦Canada joseph.olstad
Hi, for some reason d.o removed the author suggestion from the issues.
With that said, multiple contributors are being credited, including sarathkm see below:
Issue #3150700 by sarathkm, kerasai, HeikkiY, mayela: Conditional Fields Integration