- 🇨🇦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] => )
- 🇦🇺Australia imranbcc
I am still facing this issue on version 6.2.9.
Try the following form YAML:
page_1: '#type': wizard_page '#title': 'Page 1' name: '#type': textfield '#title': Name '#required': true email: '#type': email '#title': Email require_interpreter_assistance: '#type': radios '#title': 'Do you require interpreter assistance for the interview?' '#options': 1: 'Language interpreter' 2: 'Auslan interpreter' 3: 'Not required' '#options_display': buttons language_required_for_interpreter: '#type': select_other '#title': 'Chose the language required for the interpreter' '#options': 1: Urdu 2: Punjabi 3: 'Filipino/ Tagalog' 4: Greek 5: Maltese '#other__option_label': 'Other language' '#other__placeholder': '' '#other__description': 'Enter language' '#states': visible: ':input[name="require_interpreter_assistance"]': value: '1' summary: '#type': wizard_page '#title': Summary markup: '#type': markup '#markup': '<p>You are about to submit</p>' data_summary: '#type': computed_token '#title': Summary '#display_on': form '#mode': html '#template': '[webform_submission:values]' actions: '#type': webform_actions '#title': 'Submit button(s)'
If I remove `computed_token` field, the problem is gone.