Page MenuHomePhabricator

Switching from wikitext mode to visual editor converts the local "DEFAULTSORT" message to the English message
Closed, ResolvedPublic0 Estimated Story Points

Description

If I start editing a new article on wikitext mode and make everything ready, meaning I have already added a local DEFAULTSORT message, on Finnish Wikipedia it is AAKKOSTUS.

I then switch to visual editor and see the system has changed AAKKOSTUS to DEFAULTSORT.

It should not be changed to the English message.
Not either categories have translated to English during the switch.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF claimed this task.
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set the point value for this task to 0.
Jdforrester-WMF edited projects, added Parsoid; removed VisualEditor-ContentLanguage.
Jdforrester-WMF subscribed.

This looks like Parsoid was reading the fiwiki config from the wrong end (or the config was itself wrong), but AFAICT it's now fixed. Can you confirm?

Hi @Jdforrester-WMF, I found this bug while searching for something else. I went ahead and tested it, and can confirm this still happens (on both the Finnish and the Norwegian Bokmål Wikipedias, so presumably everywhere). To test, go to any non-existant title in the article space on https://no.wikipedia.org/, start editing in source mode, type in {{STANDARDSORTERING:something}}, switch to VE and switch back, and it will have been changed to {{DEFAULTSORT}}.

Arlolra subscribed.

Parsoid currently keeps the source of those magic words when parsing,

echo "{{AAKKOSTUS}}" | php bin/parse.php --domain fi.wikipedia.org
<meta property="mw:PageProp/categorydefaultsort" content="" data-parsoid='{"src":"{{AAKKOSTUS}}","dsr":[0,13,null,null]}'/>

so that it can roundtrip it if present,

echo "{{AAKKOSTUS}}" | php bin/parse.php --domain fi.wikipedia.org --wt2wt
{{AAKKOSTUS}}

However, without the src, it just falls back to the English part in the "property" attribute,
https://github.com/wikimedia/parsoid/blob/master/src/Html2Wt/DOMHandlers/MetaHandler.php#L53-L58

A task to use first entry in the config is filed as T87382

matmarex moved this task from External and Administrivia to To Triage on the VisualEditor board.
matmarex subscribed.

I guess this became invalid for Parsoid when its special handling for DEFAULTSORT was removed in https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/908937 (as discussed in T337398), instead it's a VisualEditor bug now.

matmarex assigned this task to Nardog.

It looks like @Nardog's patch https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/972928 for T337398 resolved this. Thank you!

I think we can close this task, and I'll leave a note on the other one for the Editing team QA engineers, in case they want to verify this as well.