Defer the user save in onCustomEditor() to post-send

Bug: T92357
Change-Id: Ifc71b57f006673b2ea62175976292ca0562fc787
This commit is contained in:
Aaron Schulz 2016-03-24 14:21:39 -07:00
parent 3028f4f2d6
commit 42943a49d1

View file

@ -132,7 +132,9 @@ class VisualEditorHooks {
if ( isset( $params['venoscript'] ) ) {
$req->response()->setCookie( 'VEE', 'wikitext', 0, [ 'prefix' => '' ] );
$user->setOption( 'visualeditor-editor', 'wikitext' );
$user->saveSettings();
DeferredUpdates::addCallableUpdate( function () use ( $user ) {
$user->saveSettings();
} );
return true;
}