Custom validate and submit don't works I made my custom module, and wanted to do some staff in the validation and submission handlers. My Fields are in two field sets:


Member profile, with username and password
Company profile, with company name, URL, location, and logo


I am also using the #states attribute on some fields, but everything works except the validation and submission handlers. 

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  switch ($form_id) {
    case 'user_profile_form':
      // Only pre-render works.  
      $form['#pre_render'][] = 'mymodule_user_profile_form_pre_render';
      // I try to empty fields with states attribute, but without success. Disabled work OK.
      $form['field_company_url']['und']['0']['value']['#states'] = array(
       'empty' =&gt; array(':input[name="field_company_confidential[und]"]' =&gt; array('checked' =&gt; TRUE)),
       'disabled' =&gt; array(':input[name="field_company_confidential[und]"]' =&gt; array('checked' =&gt; TRUE)),);


      // These don't work as expected.
      $form['#validate'][] = 'mymodule_user_profile_form_validate';
      $form['#submit'][] = 'mymodule_user_profile_form_submit';

      // I also tried this one.
      // $form['actions']['submit']['#submit'][] = 'mymodule_user_profile_form_submit'; 
  }
}

function mymodule_user_profile_form_submit($form, &amp;$form_state) { 
  // I want to download the image from another website and set as logo.
}

function mymodule_user_profile_form_validate($form, &amp;$form_state) { 
  //I need to check if checkbox is checked to empty all other fields.
  if ($form_state['values']['field_company_confidential'] == TRUE) {
    $form_state['values']['field_company_url']['und']['0'] = '';
  }

  return $form;
}


When I try to access $form_state['values'], I don't get any value. 



What I am doing wrong?
The main problem was with devel module. 
When I disable it and try again all job everything works perfect.
So maybe was some bugs with devel module, but I am not sure.