From 5f58ed3d6f2e9fcac2074a37bfa440b07e2a820a Mon Sep 17 00:00:00 2001
From: Jennifer Hodgdon <yahgrp@poplarware.com>
Date: Mon, 19 Mar 2012 06:57:02 -0700
Subject: [PATCH] Issue #1483664 by nmudgal, chertzog: Fix hook_user_presave
 example so it actually would work

---
 core/modules/user/user.api.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index 752d3d412d7f..dc16906470de 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -243,9 +243,10 @@ function hook_user_operations() {
  * @see hook_user_update()
  */
 function hook_user_presave(&$edit, $account) {
-  // Make sure that our form value 'mymodule_foo' is stored as 'mymodule_bar'.
+  // Make sure that our form value 'mymodule_foo' is stored as
+  // 'mymodule_bar' in the 'data' (serialized) column.
   if (isset($edit['mymodule_foo'])) {
-    $edit['data']['my_module_foo'] = $edit['my_module_foo'];
+    $edit['data']['mymodule_bar'] = $edit['mymodule_foo'];
   }
 }
 
-- 
GitLab