Community

[SLOVED] Can not call dsm() in extra user submit form

Hello everybody,
I call this alter function an set a extra submit function. This submit function is ok but it wont retrun my dsm.
Any ideas?

<?php
function user_edit_form_alter(&$form) {

 
// Check if the form is the user form
 
if (isset($form['form_id']['#id']) && $form['form_id']['#id'] == 'edit-user-profile-form') {
   
// drupal_set_message('I am in user edit form.');
    // Set a extra Submit
   
$form['#submit'][] = 'user_edit_submit';
  }
}

/**
* Extra Submit function to store the changed values in the Database.
*/
function user_edit_submit($form, &$form_state) {
 
dsm($form_state);
 
}
?>

Comments

It is strange I just tried to

It is strange I just tried to do some blind coding an get some values from $form_state and it works.
Soooo thats kind of weird because I can't display the $form_state.

<?php
function user_edit_submit($form, &$form_state) {
 
// Can't use global $user.
  // If Admin would edit something
  // it would go wrong

 
$uid = $form['#user']->uid;
 
 
$change = array(
   
'field' => 'username',
   
'value' => 'Timo Vogt');
 
 
$changes_plz = array(
   
'field' => 'field_plz',
   
'value' => '42799');

 
$changes = array($change,$changes_plz);
 
dsm($changes); // This dsm works XD
 
for ($i = 0; $i < count($changes); $i++) {
   
$change = db_insert('users_edit_history')
        ->
fields(array(
         
'uid' => $uid,
         
'value' => $changes[$i]['value'],
         
'field' => $changes[$i]['field'],
         
        ))
        ->
execute();
  }
}
?>

Until the server crashes you're doing it quite right

Oke this is the funnyest

Oke this is the funnyest thing i ever saw while I working with Drupal.
dsm($form_state['input']);
is working wile
dsm($form_state);
is not.
[SLOVED]

Until the server crashes you're doing it quite right

nobody click here