0
function send_xml_form_user_profile_form_alter(&$form, &$form_state){
    $form["#submit"][] = 'send_xml_edit_account_submit_function';
    drupal_set_message('<pre>' . print_r($form['#submit'], TRUE) . '</pre>');
}

function send_xml_edit_account_submit_function($form, &$form_state) {
    drupal_set_message(t("ahoy"));
}

the modules name is send_xml.module.

this code drupal_set_message('<pre>' . print_r($form['#submit'], TRUE) . '</pre>'); displays

Array
(
     [0] => user_profile_form_submit
     [1] => send_xml_edit_account_submit_function
)

but this code drupal_set_message(t("ahoy")); isnt displaying...

anyone ring a bell?

it's quite annoying to have problems which you cant find the reason why... does anyone experience this before? if yes, would please so kind to share your solutions to me. thank you very much! :)

1
  • take a look at this discussion and its comments.. Probably, some of higher callback is stopping the process...
    – xurshid29
    Apr 4, 2014 at 10:08

2 Answers 2

0

Can you try

function send_xml_form_user_profile_form_alter(&$form, &$form_state, $form_id){
    $form['actions']['submit']['#submit'][] = 'send_xml_edit_account_submit_function';
    drupal_set_message('<pre>' . print_r($form['#submit'], TRUE) . '</pre>');
}

Try clearing Drupal cache before you see the changes..

0

There are many ways to fix this problem @Anil sagar has aslo gave the right answer. Another approach you can take is :

/**
 * Implements hook_form_alter().
 */
function send_xml_form_alter(&$form, &$form_state, $form_id) {
  if($form_id == 'user_profile_form') {
          $form['#submit'][] = 'send_xml_edit_account_submit';
   }
}

function send_xml_edit_account_submit($form, &$form_state) {
    print '<pre>';print_r($form['#submit']);  die;
}

Do not use function keyword in a declaration of function on send_xml_edit_account_submit_function

Try it, I tried its works for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.