jenkins-bot has submitted this change and it was merged.

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


Do not call saveSettings() on anon users

Also actually check wfReadOnly().

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

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 3c6fe77..487984c 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -132,9 +132,11 @@
                if ( isset( $params['venoscript'] ) ) {
                        $req->response()->setCookie( 'VEE', 'wikitext', 0, [ 
'prefix' => '' ] );
                        $user->setOption( 'visualeditor-editor', 'wikitext' );
-                       DeferredUpdates::addCallableUpdate( function () use ( 
$user ) {
-                               $user->saveSettings();
-                       } );
+                       if ( !wfReadOnly() && !$user->isAnon() ) {
+                               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: merged
Gerrit-Change-Id: I83e78532c66039e9764e70246bd6597a2bf4e60f
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to