Other options will be never added permanently to the list of options using a multiselect widget (it works nice for single select).
Have a look at following code fragment:
if (
$element['select']['#value'] == 'select_or_other' &&
!empty($element['other']['#value']) &&
!isset($element['#options'][$element['other']['#value']])
) { ...
The first condition isn't fulfilled using multiselect widgets (it contains an array with key and value 'select_or_other' instead of a string 'select_or_other'). Perhaps we can simply add a condition for multiselect checking for key:
if (
($element['select']['#value'] == 'select_or_other' || isset($element['select']['#value']['select_or_other'])) &&
!empty($element['other']['#value']) &&
!isset($element['#options'][$element['other']['#value']])
) { ...
For me, it works, but I'm not sure if this change is useful?
Comments
Comment #1
danielb commentedcheers I changed it to
more consistent with the way it's done elsewhere
thanks!
Comment #3
danielb commented-