Page MenuHomePhabricator

[Regression] English magic words replaced with opposite localized ones while editing in VE
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproduce:

  1. https://de.wikipedia.org/wiki/Benutzer:Schnark?veaction=edit
  2. Change the headline "Neue Artikel" to "Neue Artikel foo" (or whatever)
  3. Review your changes.

Expected result (which worked recently):
Only your change is made and shown.

Actual result:
Also __NOTOC__ -> __INHALTSVERZEICHNIS_ERZWINGEN__ and __NOINDEX__ -> __INDEXIEREN__ are changed. These are the localized versions of the opposite.
Note that __NOEDITSECTION__ is not changed.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jdforrester-WMF triaged this task as Unbreak Now! priority.May 2 2017, 7:16 PM
Jdforrester-WMF added a project: Parsoid.
Jdforrester-WMF subscribed.

The language changing can only be done by Parsoid (VE doesn't know or care); did the code there for this change recently?

When I follow instructions in https://www.mediawiki.org/wiki/Parsoid/Debugging#Dumping_HTML_DOM_in_VE and dump the orig HTML and modified HTML and diff them, here is what I see on the first line. So, looks like some VE bug.

1c1
< <body id="mwAA" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki" dir="ltr" lang="de"><meta property="mw:PageProp/notoc" id="mwAQ"> <meta property="mw:PageProp/noeditsection" id="mwAg"> <meta property="mw:PageProp/noindex" id="mwAw"><h1 style="display:none;" id="mwBA"></h1><!--HACK für mobile Ansicht-->
---
> <body id="mwAA" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki" dir="ltr" lang="de"><meta property="mw:PageProp/forcetoc" id="mwAQ"> <meta property="mw:PageProp/noeditsection" id="mwAg"> <meta property="mw:PageProp/index" id="mwAw"><h1 style="display:none;" id="mwBA"></h1><!--HACK für mobile Ansicht-->

Parsoid respects the language preferences of the home wiki, as expressed by the order of the options in MessagesXX.php (see T116020 for context, and 9e60ff49ba3d4232957b83c209a5e3878210d2cf for implementation in core). That hasn't changed recently, and I don't see any relevant recent changes to MessagesXX.php in core (last change to German was 7fac74ae43dcca5d514e063c7672de68ecb15b91.) But it only rewrites sections of the document which have changed. So apparently (see @ssastry's comment above) VE has gotten these switched somehow recently when round-tripping, which causes Parsoid to detect the region as "changed" and reserialize them in German -- to the thing which VE says is now there, which is the opposite of what it was.

@Jdforrester-WMF -- ball's in your court. ;)

Change 351521 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Follow-up 57a06a6: Use the same attribute name on read and on write

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

Jdforrester-WMF set the point value for this task to 1.

Yes, the change in language threw me, but is exactly the expected (and desired) behaviour for edits where the user actually changes the flag; it's just that, well, VE's recent code here was over-writing this wrongly.

Change 351521 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Follow-up 57a06a6: Use the same attribute name on read and on write

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

Change 351527 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@wmf/1.29.0-wmf.21] Follow-up 57a06a6: Use the same attribute name on read and on write

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

Change 351527 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@wmf/1.29.0-wmf.21] Follow-up 57a06a6: Use the same attribute name on read and on write

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

Now live in production; sorry all.

Mentioned in SAL (#wikimedia-operations) [2017-05-08T18:36:39Z] <catrope@tin> Synchronized php-1.29.0-wmf.21/extensions/VisualEditor/modules/ve-mw/dm/metaitems/ve.dm.MWFlaggedMetaItem.js: T164054 (duration: 00m 38s)

Hello,

we run mw-1.29.1 and ve 0.1.0 and still have this issue. Did I miss something?

Best regards

we run mw-1.29.1 and ve 0.1.0 and still have this issue. Did I miss something?

The standard advice is to upgrade everything to the latest versions and see if the issue persists.

Thank you for responding so quickly.

Our wiki is in productive use and AFAICS we use latest stable versions of Mediawiki and Visual Editor.
Should I try to adapt patch manually?

Thank you for responding so quickly.

Our wiki is in productive use and AFAICS we use latest stable versions of Mediawiki and Visual Editor.

It looks like you do. Sorry, I had missed that.

Still, if you had, say, downloaded 1.29.1 before the patch above was backported (e.g. before 8th May 2017) then even though you're running 1.29.1 you still wouldn't have the patch. When was the last time you updated?

Should I try to adapt patch manually?

I don't think that'd do you much good. If you're running the latest version then the patch would be working. Try checking the bit of the code the patch changed (lines 33 through 52 in ve.dm.MWFlaggedMetaItem.js) and see whether it matches the version before the patch or the version after the patch. If it's the version before, then you know that you're not running the latest code.

I downloaded VE version suitable to our MW version.
Got the link: https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_29-ef45039.tar.gz
This version does not contain commit changes.

Should I manually edit this single file or use newer version of VE? If second then which version to use?

I downloaded VE version suitable to our MW version.
Got the link: https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_29-ef45039.tar.gz
This version does not contain commit changes.

Should I manually edit this single file or use newer version of VE? If second then which version to use?

This is beyond my expertise. I am not an engineer. So take my below guesswork with a pinch of salt. :-)

Presumably you could just edit that file to change the code, but that is a hack that will likely come crashing down on you at some point, if it even works at all.

I believe that the latest version of VisualEditor will only work with the latest version of MediaWiki core, so if you updated to 1.30 or to master, you'd also need to update MediaWiki core to a version compatible with VisualEditor, which might break compatibility with other things. You might end up getting stuck updating absolutely everything in order to get it to work, possibly to unstable versions, or it might not work.

Just patched single file "ve.dm.MWFlaggedMetaItem.js" and it works!.

Thank you for supporting me!