Commit 3d46cf44 authored by Bojan Živanović's avatar Bojan Živanović
Browse files

Issue #2764119 by bojanz, pontus_nilsson: massageFormValues calls array_values on string

parent 3fb6ec89
Loading
Loading
Loading
Loading
+2
Changes for src/Element/EntitySelect.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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.
+1 −1
Changes for src/Plugin/Field/FieldWidget/EntitySelectWidget.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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'];
  }

}