mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-24 06:54:08 +00:00
Avoid using User::setOption()
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption() Bug: T277818 Change-Id: Idd89847f2363645862b1d81488d7eb5727d8baab
This commit is contained in:
parent
d9e7ea40bb
commit
8d8e0e7da1
|
@ -108,10 +108,11 @@ class MigratePreferences extends LoggedUpdateMaintenance {
|
|||
private function updateUser( $userRow, array &$options ) {
|
||||
if ( $userRow->user_id && $options ) {
|
||||
$user = User::newFromRow( $userRow );
|
||||
$userOptionsManager = MediaWikiServices::getInstance()->getUserOptionsManager();
|
||||
foreach ( $options as $option => $value ) {
|
||||
$user->setOption( $option, $value );
|
||||
$userOptionsManager->setOption( $user, $option, $value );
|
||||
}
|
||||
$user->saveSettings();
|
||||
$userOptionsManager->saveOptions( $user );
|
||||
}
|
||||
$count = count( $options );
|
||||
$options = [];
|
||||
|
|
Loading…
Reference in a new issue