M
M
Matvey Kremnin2020-03-18 16:21:08
CMS
Matvey Kremnin, 2020-03-18 16:21:08

What is the alternative for hook_node_submit() in Drupal8?

Now I use Drupal 8.
It is necessary to write the data in the MSSiquel database when sending the completed form.
Question: How to catch pressing this button so that the data is written to the database?
thanks for the help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andead, 2020-03-18
@andead

https://www.drupal.org/node/2420295

function mymodule_form_node_form_alter(&$form, FormStateInterface $form_state) {
  $form['actions']['submit']['#submit'][] = 'mymodule_node_form_submit';
}

function mymodule_node_form_submit($form, FormStateInterface $form_state) {
  
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question