Avoid using User::setOption()

User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()

Bug: T277818
Change-Id: I46dca703deb311d7c4e06b3001357fa602a40e0a
This commit is contained in:
ZabeMath 2021-04-14 00:46:28 +02:00
parent 7e23848ac9
commit 80da86d44a

View file

@ -40,8 +40,9 @@ class Hooks {
}
if ( $user->isRegistered() ) {
$user->setOption( 'cookiewarning_dismissed', 1 );
$user->saveSettings();
$userOptionsManager = MediaWikiServices::getInstance()->getUserOptionsManager();
$userOptionsManager->setOption( $user, 'cookiewarning_dismissed', 1 );
$userOptionsManager->saveOptions( $user );
} else {
$request->response()->setCookie( 'cookiewarning_dismissed', true );
}