- Issue created by @sime
I found that adding actions_top means I can't do $form_state->setErrorByName('')
because it triggers a warning, and if I have inline_form_errors module it triggers a whitescreen.
Warning: Undefined array key "#parents" in Drupal\Core\Form\FormState->getError() (line 1137 of core/lib/Drupal/Core/Form/FormState.php).
Drupal\Core\Form\FormState->getError(Array) (Line: 165)
Drupal\Core\Form\FormErrorHandler->setElementErrorsFromFormState(Array, Object, Array) (Line: 125)
Drupal\Core\Form\FormErrorHandler->setElementErrorsFromFormState(Array, Object, Array) (Line: 125)
Drupal\Core\Form\FormErrorHandler->setElementErrorsFromFormState(Array, Object) (Line: 26)
Drupal\Core\Form\FormErrorHandler->handleFormErrors(Array, Object) (Line: 199)
Drupal\Core\Form\FormValidator->finalizeValidation(Array, Object, 'profile_doi_edit_form') (Line: 119)
Drupal\Core\Form\FormValidator->validateForm('profile_doi_edit_form', Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('profile_doi_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
$form_state->setErrorByName('', 'Some message');
My assumption is that how getElementByName() works, that if an element doesn't get a #parents key then something is not quite right in how the form is being altered.
Active
1.0
Code