Loading src/Element/EntitySelect.php +2 Changes for src/Element/EntitySelect.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -148,6 +148,8 @@ class EntitySelect extends FormElement { if ($value_element['#type'] == 'checkboxes') { // Remove unselected checkboxes. $value = array_filter($value); // Non-numeric keys can cause issues when passing values to TypedData. $value = array_values($value); } elseif (!empty($value_element['#tags'])) { // Extract the entity ids from a multivalue autocomplete. Loading src/Plugin/Field/FieldWidget/EntitySelectWidget.php +1 −1 Changes for src/Plugin/Field/FieldWidget/EntitySelectWidget.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ class EntitySelectWidget extends WidgetBase { * {@inheritdoc} */ public function massageFormValues(array $values, array $form, FormStateInterface $form_state) { return array_values($values['target_id']); return $values['target_id']; } } Loading
src/Element/EntitySelect.php +2 Changes for src/Element/EntitySelect.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -148,6 +148,8 @@ class EntitySelect extends FormElement { if ($value_element['#type'] == 'checkboxes') { // Remove unselected checkboxes. $value = array_filter($value); // Non-numeric keys can cause issues when passing values to TypedData. $value = array_values($value); } elseif (!empty($value_element['#tags'])) { // Extract the entity ids from a multivalue autocomplete. Loading
src/Plugin/Field/FieldWidget/EntitySelectWidget.php +1 −1 Changes for src/Plugin/Field/FieldWidget/EntitySelectWidget.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ class EntitySelectWidget extends WidgetBase { * {@inheritdoc} */ public function massageFormValues(array $values, array $form, FormStateInterface $form_state) { return array_values($values['target_id']); return $values['target_id']; } }