From 42943a49d171e92908915e4dae1d6a1e6a625819 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 24 Mar 2016 14:21:39 -0700 Subject: [PATCH] Defer the user save in onCustomEditor() to post-send Bug: T92357 Change-Id: Ifc71b57f006673b2ea62175976292ca0562fc787 --- VisualEditor.hooks.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index 77466e236d..8bc41ba766 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -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; }