Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. use DrupalCoreFormFormStateInterface;
  2. use SymfonyComponentHttpFoundationRequest;
  3.  
  4. function testmodule_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  5. foreach (array_keys($form['tasks']) as $action) {
  6. if ($action != 'preview' && isset($form['tasks'][$action]['#type']) && $form['tasks'][$action]['#type'] === 'submit') {
  7. $form['tasks'][$action]['#submit'][] = 'testmodule_form_submit';
  8. }
  9. }
  10. }
  11.  
  12.  
  13. function testmodule_form_submit(array $form, FormStateInterface $form_state){
  14. drupal_set_message("Why won't this message show?");
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement