Commit 6083731c authored by Dries's avatar Dries

- Patch #645374 by sun: make object IDs available to form submit handlers....

- Patch #645374 by sun: make object IDs available to form submit handlers. This should be a best practice, IMO.
parent f7992435
......@@ -2031,6 +2031,7 @@ function comment_form_submit($form, &$form_state) {
}
comment_save($comment);
$form_state['values']['cid'] = $comment->cid;
// Explain the approval queue if necessary.
if ($comment->status == COMMENT_NOT_PUBLISHED) {
if (!user_access('administer comments')) {
......
......@@ -434,6 +434,7 @@ function node_form_submit($form, &$form_state) {
}
if ($node->nid) {
unset($form_state['rebuild']);
$form_state['values']['nid'] = $node->nid;
$form_state['nid'] = $node->nid;
$form_state['redirect'] = 'node/' . $node->nid;
}
......
......@@ -222,6 +222,7 @@ function taxonomy_form_vocabulary_submit($form, &$form_state) {
break;
}
$form_state['values']['vid'] = $vocabulary->vid;
$form_state['vid'] = $vocabulary->vid;
$form_state['redirect'] = 'admin/structure/taxonomy';
}
......@@ -811,9 +812,9 @@ function taxonomy_form_term_submit($form, &$form_state) {
taxonomy_vocabulary_save($form['#vocabulary']);
}
$form_state['values']['tid'] = $term->tid;
$form_state['tid'] = $term->tid;
$form_state['redirect'] = 'admin/structure/taxonomy';
return;
}
/**
......
......@@ -3166,6 +3166,7 @@ function user_register_submit($form, &$form_state) {
return;
}
$form_state['user'] = $account;
$form_state['values']['uid'] = $account->uid;
watchdog('user', 'New user: %name (%email).', array('%name' => $form_state['values']['name'], '%email' => $form_state['values']['mail']), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $account->uid . '/edit'));
......
......@@ -277,6 +277,7 @@ function user_profile_form_submit($form, &$form_state) {
$edit = (array)$edit;
user_save($account, $edit, $category);
$form_state['values']['uid'] = $account->uid;
// Clear the page cache because pages can contain usernames and/or profile information:
cache_clear_all();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment