Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/284702

Change subject: Do not call saveSettings() on anon users
......................................................................

Do not call saveSettings() on anon users

Change-Id: I83e78532c66039e9764e70246bd6597a2bf4e60f
---
M VisualEditor.hooks.php
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/02/284702/1

diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 3c6fe77..7614a89 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -132,9 +132,12 @@
                if ( isset( $params['venoscript'] ) ) {
                        $req->response()->setCookie( 'VEE', 'wikitext', 0, [ 
'prefix' => '' ] );
                        $user->setOption( 'visualeditor-editor', 'wikitext' );
-                       DeferredUpdates::addCallableUpdate( function () use ( 
$user ) {
-                               $user->saveSettings();
-                       } );
+                       $user->setOption( 'visualeditor-editor', 'wikitext' );
+                       if ( $user->getId() ) {
+                               DeferredUpdates::addCallableUpdate( function () 
use ( $user ) {
+                                       $user->saveSettings();
+                               } );
+                       }
                        return true;
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/284702
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83e78532c66039e9764e70246bd6597a2bf4e60f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to