Commit 1a4615ea authored by Luke Leber's avatar Luke Leber
Browse files

Issue #3269512 by Luke.Leber, carolpettirossi: Fatal error when creating an...

Issue #3269512 by Luke.Leber, carolpettirossi: Fatal error when creating an entity reference field listing Fields config entity
parent 15a3009e
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -162,4 +162,17 @@ class ConfigEntityReferenceSelection extends DefaultSelection {
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    parent::validateConfigurationForm($form, $form_state);

    // Ensure that the allowed_ids sequence is stored without keys.
    $value_path = ['settings', 'handler_settings', 'filter', 'allowed_ids'];
    $with_keys = $form_state->getValue($value_path);
    $without_keys = array_values($with_keys);
    $form_state->setValue($value_path, $without_keys);
  }

}