How can I process a node form from a custom submit handler? I have a use case where I have a custom submit button on a node edit form that will take the user off to another page to do some other editing.

If the user has made some changes to the node, such as changed the title, I need to save the current node before redirecting them off to the new page (along with some other generated ID's).

For the life of me, I cant seem to see how I can save the changes to the node in my custom submit handler.
I have tried using $formState-&gt;prepareCallback('::submitform()) but that doesn't seem to do what I expected of processing the form.

Anyone done this before or got any good ideas?
Typically, I found the answer 10 minutes after posting!

For anyone else, in your custom submit handler get the form object from the form state.

$formObj = $formState-&gt;getFormObject();


You can then call submitForm() on the form object and pass the form and form state variables.

$formObj-&gt;submitForm($form, $formState);


Then finally just simply trigger the save() function on the object.

$formObj-&gt;save($form, $formState);