In my signup form, I've moved the `$form['actions']` element to a wrapper so the structure is now: `$form['container']['actions']`.
This breaks the ajax submit functionality, because in the ajax submit, the following happens:
public function ajaxSubmit(array $form, FormStateInterface $form_state) {
$response = new AjaxResponse();
$response_wrapper_id = '#' . $form['actions']['submit']['#ajax']['response_wrapper'];
...
}
Due to it being bad practice to call the element directly in any case, I propose we replace it with this instead:
public function ajaxSubmit(array $form, FormStateInterface $form_state) {
$triggering_element = $form_state->getTriggeringElement();
$response = new AjaxResponse();
$response_wrapper_id = '#' . $triggering_element['#ajax']['response_wrapper'];
...
}
Then it doesn't matter where the actions element is located, since the button should always be the triggering element.
Test MR.
Needs review
2.0
Signup Module