- π¨π¦Canada endless_wander
This still causes an error for me when using the updated code from this issue. The new condition still fails and therefore this code is not run:
$value = $class::processValue($element, $value);
The new condition also has an illegal isset() function that returns false so I changed this:
if (is_array($value) && count($value) === 2 && array_key_exists($type, $value) && isset($value['other']))
to this:
if (is_array($value) && count($value) === 2 && array_key_exists($type, $value) && array_key_exists('other', $value))
And now the code is working if the value of $value['other'] is empty or null.
Attached patch makes this change
- π¦πΊAustralia Mingsong π¦πΊ
So, that means $value['other'] is NULL? Is my understanding right?
Could you give more details about how to reproduce the error you came across?
- π¨π¦Canada endless_wander
Yes, $value['other'] == NULL in my scenario.
The element looks like this:
product_list_attached: '#type': radios_other '#title': 'Product list attached' '#options': 1: 'Yes - I will attach' '#other__type': textarea '#other__option_label': 'No - explain:' '#other__placeholder': '' '#required': true
In the submission triggering the error, option 1 was selected and so the $value array was:
Array ( [radios] => 1 [other] => )