Page MenuHomePhabricator

VE does not support wikitext in system messages
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  • MW installations with SSO integration where the SSO has an unreasonably strict CORS Policy will result in VE producing the "something went wrong" and "try again" errors when the SSO session expires. The situation involves the following system messages:
    • ooui-dialog-process-error
    • ooui-dialog-process-retry

ref: https://www.mediawiki.org/wiki/Topic:V2qh378y0tj83so8

Actual Results:
The result is a purely informative state which does not provide any help to the use in how to solve the most likely underlying issue. An attempt to improve the situation by customizing the system messages is helpful but the current state of VE is such that the system messages do not support wiki text.

  • Attempts to to add a helpful custom external link to the VE system messages do not render as a link in the VE dialogue box.

Expected Results:

  • Attempts to to add a helpful custom external link to the VE system messages should render as a link in the VE dialogue box.

Event Timeline

Tgr removed Tgr as the assignee of this task.Jul 5 2019, 6:24 PM
Tgr added a project: I18n.
Tgr subscribed.

Allowing links in error messages is useful in general as site admins might want to link to the bug tracker, their organization's IT desk / support forum, document workarounds for specific issues they have etc.

Thanks, Tgr.. how do this kind of things get prioritized? Is this feature request in the dead-letter office?

The messages you're referring to are not error messages, but rather the heading of an error message and a button underneath it. It would be somewhat complicated to support wikitext in them, as they are a part of the OOUI library, which doesn't even know what wikitext or MediaWiki is.

image.png (361×523 px, 23 KB)

(Screenshot from OOUI demos – "1" is ooui-dialog-process-error and "2" is ooui-dialog-process-retry).


I think what you really want is to have wikitext in the error message in the middle ("3"), and good news – they definitely can support wikitext, since they are generated by MediaWiki. For example, the error message shown when trying to add blacklisted links (https://en.wikipedia.org/wiki/MediaWiki:Spamprotectiontext) is shown parsed:

image.png (980×1 px, 186 KB)

If you could find out what error message is being shown in your case (or at least give us a screenshot), we can find out why wikitext doesn't work in it, and fix it.

Unfortunately it seems that 3 is not a system message and is hard-coded by VE as raw text

Screen Shot 07-17-19 at 09.43 AM.PNG (391×525 px, 26 KB)

Screen Shot 07-17-19 at 09.44 AM.PNG (478×817 px, 40 KB)

Tested with wiki text as well.

Would it make sense then to modify VE to use a system message that supports wikitext?

Yes, that definitely should be a localisable message.

I looked in that file for other possible unlocalised messages (strings that contain spaces) and found a couple:

modules/ve-mw/init/ve.init.mw.ArticleTarget.js:
 442: 					'returned by server do not match'
 652: 		this.saveFail( doc, saveData, false, null, 'Invalid response from server', response );
 655: 		this.saveFail( doc, saveData, false, null, 'Save failure', response );
 657: 		this.saveFail( doc, saveData, false, null, 'Invalid HTML content in response from server', response );
 844: 		unknown = 'Unknown error';
 847: 		unknown += ', HTTP status ' + data.xhr.status;
 907: 		this.serializeFail( null, 'Invalid response from server', null );
 910: 			null, 'Unsuccessful request: ' + response.error.info, null
 913: 		this.serializeFail( null, 'Server error', null );
 916: 			null, 'No Wikitext content in response from server', null
1687: 				return $.Deferred().reject( 'Invalid response from server' ).promise();
1694: 				return $.Deferred().reject( 'Failed request: ' + data.result ).promise();
1696: 				return $.Deferred().reject( 'Invalid HTML content in response from server' ).promise();

Not sure if all of these are mistakes – non-localised errors should be used if the error is only ever printed to browser console (or thrown), but all text shown to users should be localised.

Sounds like an issue that might gain traction in the WMF group. What are the odds someone will make the message I care about a localized message in a reasonable timeframe?

I am planning to work on this but can't promise when. If you're able to, feel free to send in a patch.

Change 551650 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Localize some hardcoded English error messages

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

Change 551650 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Localize some hardcoded English error messages

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

Change 571810 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Localize remaining hardcoded English error messages

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

Change 571810 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Localize remaining hardcoded English error messages

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

With that patch, all of our error messages should be localisable, and they should support wikitext (with the limitations described at https://www.mediawiki.org/wiki/Manual:Messages_API#Feature_support_in_JavaScript).

(Most of the involved error messages are impossible to QA without actually misconfiguring a server or modifying the source code to trigger them, so I'm moving this directly to signoff. I tested myself that they display correctly when they're shown.)

@Revansx Also, FYI, the error message you complained about originally (T227325#5341011) is now defined in MediaWiki core rather than VisualEditor, as a result of changes from T240519. I think the relevant message is api-clientside-error-noconnect (but I'm not entirely sure, I can't test in that configuration, and there are now some more specific error messages).