Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

The following hooks have been updated in the same way and only receive the updated $account entity. The original, unchanged $account can be accessed through $account->original.

  • hook_user_presave()
  • hook_user_insert()
  • hook_user_update()
<?php
// Drupal 7
function mymodule_user_presave(&$edit, $account, $category) {
 
// 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']['mymodule_bar'] = $edit['mymodule_foo'];
  }
}

// Drupal 8
function mymodule_user_presave($account) {
 
// Make sure that our form value 'mymodule_foo' is stored as
  // 'mymodule_bar' in the 'data' (serialized) column.
 
if (isset($account->mymodule_foo)) {
   
$account->data['mymodule_bar'] = $account->mymodule_foo;
  }
}
?>
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done