mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CookieWarning
synced 2024-11-23 22:03:41 +00:00
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:
parent
7e23848ac9
commit
80da86d44a
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue