Skip to content
Snippets Groups Projects
Commit 5f58ed3d authored by Jennifer Hodgdon's avatar Jennifer Hodgdon
Browse files

Issue #1483664 by nmudgal, chertzog: Fix hook_user_presave example so it actually would work

parent 7083dd10
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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'];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment