Page MenuHomePhabricator

When mediawiki is in maintenance mode (read only), visual editor shows unparsed wikitext if the wiki has over-ridden the default message with a worse one
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproduce:

  1. Put English Wikipedia in read only mode with: https://gerrit.wikimedia.org/r/#/c/346251/3/wmf-config/db-eqiad.php
  2. Edit any page (I used what I think is the source version of the visual editor, but I would assume it works similary in all options (the message is nice on the old source editor)
  3. Hit save
  4. Ugly json is shown, instead of pretty explanation that mediawiki is in read only, and the message why.

Suggested patch:

Probably a bit of json parsing the error + CSS would be more than enough.

Event Timeline

It looks like that configuration change should be mostly equivalent to setting setting $wgReadOnly = 'foo bar'; locally.

But I can't reproduce this. Instead, trying to save changes results in infinitely repeating requests for action=query&meta=tokens and action=visualeditoredit (which fails with 'badtoken')…

Any chance you saved the exact error message?

Any chance you saved the exact error message?

I kept the browser open, but we had worse issues and finally forgot to get a screnshot. But we can reproduce it again in 2 weeks in the next switchover. I just remember it gave an error and printed the json instead of parsing it and put it "pretty".

My infinite loop issue is T163492/T163493. But I can't reproduce this problem if that is worked around. I get a pretty error message:

image.png (968×1 px, 119 KB)

No, I am 99% sure we got JSON there and not "that pretty". Maybe different backend or something? I do not think this is a big deal, I only reported it because it looked like an easy to solve issue (pure cosmetics).

Yeah, it must be some difference between my local setup and our production setup, I'm just saying that I can't reproduce it myself and without any hint as to what the actual error/JSON displayed was, I can do nothing about it right now. I guess someone else could try? Best I can do is to be around during the production read-only time during the switchover in two weeks, and try to reproduce then.

matmarex changed the task status from Open to Stalled.Apr 20 2017, 8:44 PM

You could try using the 'readonly' option of X-Wikimedia-Debug to reproduce it.

Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 1.
matmarex changed the task status from Stalled to Open.Apr 20 2017, 9:04 PM

Oh, that's neat, I didn't realize it's an option. In production I get this:

image.png (968×1 px, 202 KB)

…that's not JSON, that's just your friendly MediaWiki template syntax ;) It comes from https://en.wikipedia.org/w/index.php?title=MediaWiki:Readonlywarning&action=edit.

So we need to either convince the English Wikipedia community that they don't need all this crap, or make VisualEditor parse the error message using the real PHP parser rather than client-side jQueryMsg.

Jdforrester-WMF renamed this task from When mediawiki is in maintenance mode (read only), visual editor shows non-user-friendly json with the error to When mediawiki is in maintenance mode (read only), visual editor shows unparsed wikitext if the wiki has over-ridden the default message with a worse one.Apr 20 2017, 9:05 PM

(As a side note, the "Review your changes" button in the dialog footer shouldn't overlap the error message. That's T163504.)

Change 349340 had a related patch set uploaded (by Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] ve.init.mw.ArticleTarget: Use a simpler error message when site is read-only

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

Change 349340 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ve.init.mw.ArticleTarget: Use a simpler error message when site is read-only

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