Account created on 13 November 2015, over 8 years ago
#

Recent comments

I 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.
} 

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 field

Production build 0.69.0 2024