- Issue created by @Liam Morland
I have a form that extends FormBase
. In my implementation of ::validateForm()
, when I use ::setErrorByName()
, I want to pass data back to ::buildForm()
so that I can display information to help the user fix the validation problem. I've tried using $form_state->set()
in ::validateForm()
but when I call $form_state->get()
in ::buildForm()
, the data is not there. (I tried calling $form_state->setRebuild()
. It does not make a difference.)
The form is multi-step. If I do not call ::setErrorByName()
, then the data set via $form_state->set()
is available when the next page of the form is built in ::buildForm()
.
I think this is the same issue as in the parent ticket. (The form in the parent uses Ajax; mine does not. I don't think this issue is related to Ajax.) The parent was closed that this behaviour is expected. I don't understand why that would be.
Active
10.1 β¨
Last updated