From 2278f87b892419f392f303f937e751e1a6cfd702 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Sat, 28 Nov 2015 23:10:40 +0000 Subject: [PATCH] Do not try to save options for anonymous user This change requires 65062d3c from core included in MediaWiki 1.20+. Change-Id: I130ab8e93107e066d2cb757c511c844e161b703f --- modules/jquery.codeEditor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js index b640978c..b51d16e2 100644 --- a/modules/jquery.codeEditor.js +++ b/modules/jquery.codeEditor.js @@ -294,6 +294,10 @@ }, setCodeEditorPreference: function ( prefValue ) { var api = new mw.Api(); + // Do not try to save options for anonymous user + if ( mw.user.isAnon() ) { + return; + } api.postWithToken( 'options', { action: 'options', optionname: 'usecodeeditor',