summaryrefslogtreecommitdiff
path: root/modules/user/user.api.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-20 14:55:06 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-20 14:55:06 +0000
commit3b3f0966682cb69c5d701bb7d8f56fd3f479a961 (patch)
treea1ec13540dc355daedecc452d269616603feeee0 /modules/user/user.api.php
parent883a870160354fae729e91293ab6cc7399f3e85c (diff)
downloadbrdo-3b3f0966682cb69c5d701bb7d8f56fd3f479a961.tar.gz
brdo-3b3f0966682cb69c5d701bb7d8f56fd3f479a961.tar.bz2
- Patch #721436 by catch, chx, moshe weitzman: remove magical fairy saving of cruft from user_save().
Diffstat (limited to 'modules/user/user.api.php')
-rw-r--r--modules/user/user.api.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/modules/user/user.api.php b/modules/user/user.api.php
index 07f28611c..2200555dd 100644
--- a/modules/user/user.api.php
+++ b/modules/user/user.api.php
@@ -198,10 +198,8 @@ function hook_user_categories() {
*
* This hook is primarily intended for modules that want to store properties in
* the serialized {users}.data column, which is automatically loaded whenever a
- * user account object is loaded, and the module needs to prepare the stored
- * data in some way.
- * The module should save its custom additions to the user object into the
- * database and set the saved fields to NULL in $edit.
+ * user account object is loaded, modules may add to $edit['data'] in order
+ * to have their data serialized on save.
*
* @param &$edit
* The array of form values submitted by the user.
@@ -216,9 +214,7 @@ function hook_user_categories() {
function hook_user_presave(&$edit, $account, $category) {
// Make sure that our form value 'mymodule_foo' is stored as 'mymodule_bar'.
if (isset($edit['mymodule_foo'])) {
- $edit['mymodule_bar'] = $edit['mymodule_foo'];
- // Inform user_save() to ignore the value of our property.
- $edit['mymodule_foo'] = NULL;
+ $edit['data']['my_module_foo'] = $edit['my_module_foo'];
}
}
@@ -226,7 +222,7 @@ function hook_user_presave(&$edit, $account, $category) {
* A user account was created.
*
* The module should save its custom additions to the user object into the
- * database and set the saved fields to NULL in $edit.
+ * database.
*
* @param &$edit
* The array of form values submitted by the user.
@@ -245,8 +241,6 @@ function hook_user_insert(&$edit, $account, $category) {
'uid' => $account->uid,
))
->execute();
- // Inform user_save() to ignore the value of our property.
- $edit['myfield'] = NULL;
}
/**