From 80da86d44ae22e47283f548f4ac7f07a24e59550 Mon Sep 17 00:00:00 2001 From: ZabeMath Date: Wed, 14 Apr 2021 00:46:28 +0200 Subject: [PATCH] Avoid using User::setOption() User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption() Bug: T277818 Change-Id: I46dca703deb311d7c4e06b3001357fa602a40e0a --- includes/Hooks.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index 762f83b..69d4454 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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 ); }