Update cached user ID after user is added to the database
Bug: T119021 Change-Id: I5e0599d1d045b0389a7825fddc2b346e4cfd001d
This commit is contained in:
parent
4b72ec94d1
commit
780c368b5e
1 changed files with 2 additions and 1 deletions
|
|
@ -2423,7 +2423,7 @@ class User implements IDBAccessObject {
|
|||
* through the web interface.
|
||||
*/
|
||||
private function setPasswordInternal( $str ) {
|
||||
$id = self::idFromName( $this->getName() );
|
||||
$id = self::idFromName( $this->getName(), self::READ_LATEST );
|
||||
if ( $id == 0 ) {
|
||||
throw new LogicException( 'Cannot set a password for a user that is not in the database.' );
|
||||
}
|
||||
|
|
@ -3898,6 +3898,7 @@ class User implements IDBAccessObject {
|
|||
return Status::newFatal( 'userexists' );
|
||||
}
|
||||
$this->mId = $dbw->insertId();
|
||||
self::$idCacheByName[$this->mName] = $this->mId;
|
||||
|
||||
// Clear instance cache other than user table data, which is already accurate
|
||||
$this->clearInstanceCache();
|
||||
|
|
|
|||
Loading…
Reference in a new issue