Page MenuHomePhabricator

VE does not support wikitext in system messages
Open, Needs TriagePublicBUG 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

Revansx created this task.Jul 5 2019, 1:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 5 2019, 1:32 PM
Tgr removed Tgr as the assignee of this task.Jul 5 2019, 6:24 PM
Tgr added a project: I18n.
Tgr added a subscriber: Tgr.

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.

(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:

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.

Revansx added a comment.EditedJul 17 2019, 1:46 PM

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

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.