Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $form['actions']['submit']['#submit'][] = 'mymodule_upload_enabled_types_submit';
- $form['actions']['submit']['#submit'][] = 'mymodule_what_ever_function';
- $form['#submit'][1] = test_function;
- unset($form["actions"]['submit']);
- $form['actions']['submit']['#submit'][] = 'mymodule_upload_enabled_types_submit';
- $form['#submit'][] = 'mymodule_upload_enabled_types_submit';
- <?php
- use DrupalCoreFormFormStateInterface;
- /**
- * Implements hook_form_alter().
- */
- function my_module_form_alter(&$form, FormStateInterface $form_state, $form_id) {
- // Use this to reveal the form id.
- //drupal_set_message($form_id);
- // Use this with the devel module to inspect the button action(s).
- //kint($form['actions']);
- switch ($form_id) {
- case 'node_article_form': // New article nodes.
- case 'node_article_edit_form': // Existing article nodes.
- // Attach our custom submit handler.
- $form['actions']['publish']['#submit'][] = 'my_module_node_article_form_submit';
- break;
- }
- }
- function my_module_node_article_form_submit($form, FormStateInterface $form_state) {
- drupal_set_message('Running custom submit handler...');
- }
- unpublish
- preview
- delete
Add Comment
Please, Sign In to add comment