summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-01 16:03:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-01 16:03:35 +0000
commit6083731ce4b20e1752bdfb636db4e33196003193 (patch)
treefc41b7d5adb076733d19ca3c8525dc4d03f0f43e
parentf79924352fc9b1caa5e734e62f0dfa66844f31fb (diff)
downloadbrdo-6083731ce4b20e1752bdfb636db4e33196003193.tar.gz
brdo-6083731ce4b20e1752bdfb636db4e33196003193.tar.bz2
- Patch #645374 by sun: make object IDs available to form submit handlers. This should be a best practice, IMO.
-rw-r--r--modules/comment/comment.module1
-rw-r--r--modules/node/node.pages.inc1
-rw-r--r--modules/taxonomy/taxonomy.admin.inc3
-rw-r--r--modules/user/user.module1
-rw-r--r--modules/user/user.pages.inc1
5 files changed, 6 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 3ec48f3f7..583cefb80 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -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')) {
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 83ba72cbe..fe07fd15d 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -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;
}
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index a317a193a..03942a8e3 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -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;
}
/**
diff --git a/modules/user/user.module b/modules/user/user.module
index a68a3b8ef..bd12d4f38 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -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'));
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 0f42729a2..949a9fcef 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -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();