When copying state from one User object to another, don't force
the source object to be initialized. The target object can initialize
groups and options on demand as usual.
Among other things, this helps to avoid some cases of recursive calls
to User::load(), see I6d1b9fe0789b4.
Bug: T142295
Bug: T137051
Change-Id: Ib369cf5b00628550591c2ee5dcb195db7c59a59c
*/
protected function loadFromUserObject( $user ) {
$user->load();
- $user->loadGroups();
- $user->loadOptions();
foreach ( self::$mCacheVars as $var ) {
$this->$var = $user->$var;
}