diff --git a/core/modules/field/modules/list/list.module b/core/modules/field/modules/list/list.module index 6523551..97f381d 100644 --- a/core/modules/field/modules/list/list.module +++ b/core/modules/field/modules/list/list.module @@ -373,7 +373,8 @@ function _list_values_in_use($field, $values) { * - 'list_illegal_value': The value is not part of the list of allowed values. */ function list_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) { - $allowed_values = list_allowed_values($field); + // Flatten the array before validating to account for optgroups. + $allowed_values = options_array_flatten(list_allowed_values($field)); foreach ($items as $delta => $item) { if (!empty($item['value'])) { if (!empty($allowed_values) && !isset($allowed_values[$item['value']])) {