mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Merge "Defer preferences update and avoid CAS errors in onUserLoggedIn()"
This commit is contained in:
commit
dce96deee1
|
@ -1009,9 +1009,17 @@ class VisualEditorHooks {
|
|||
public static function onUserLoggedIn( $user ) {
|
||||
$cookie = RequestContext::getMain()->getRequest()->getCookie( 'VEE', '' );
|
||||
if ( $cookie === 'visualeditor' || $cookie === 'wikitext' ) {
|
||||
$user->setOption( 'visualeditor-editor', $cookie );
|
||||
$user->saveSettings();
|
||||
DeferredUpdates::addUpdate( new AtomicSectionUpdate(
|
||||
wfGetDB( DB_MASTER ),
|
||||
__METHOD__,
|
||||
function () use ( $user, $cookie ) {
|
||||
$uLatest = $user->getInstanceForUpdate();
|
||||
$uLatest->setOption( 'visualeditor-editor', $cookie );
|
||||
$uLatest->saveSettings();
|
||||
}
|
||||
) );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue