Page MenuHomePhabricator

CX template editor's own HTML may end up in the published as an HTML blob
Closed, ResolvedPublic

Description

Look at this example:

https://ba.wikipedia.org/w/index.php?title=%D0%90%D2%93%D0%B8%D2%99%D0%B5%D0%BB_%D0%BC%D3%99%D2%99%D3%99%D0%BD%D0%B8%D3%99%D1%82%D0%B5&diff=674080&oldid=674076

This is a diff between the first revision of a page, which was created by CX, and the second revision, in which the translator removed a blob of HTML.

Right before the blob there is a correctly auto-adapted template, from ru.wikipedia's {{Книга}} (Kniga) to ba.wikipedia's {{Китап}} (Kitap; this is something like {{Cite book}}).

It looks like this HTML blob is the DOM of the template editor interface itself, which must have been removed before publishing.

I'm not aware of other examples of this happening, so I cannot say how frequent this is, but it definitely happened this one time.

Event Timeline

Amire80 created this task.Apr 17 2017, 11:27 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 17 2017, 11:27 AM
santhosh triaged this task as High priority.Apr 26 2017, 10:35 AM
santhosh added a subscriber: santhosh.

Change 350408 had a related patch set uploaded (by Santhosh):
[mediawiki/extensions/ContentTranslation@master] Fix the container calculaiton for template editor

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

This bug has more sever side effect. In a translation from ru to ba for source page Варна, the large amount of unwanted mark up ended up inside a section was attempted to save. The blob was so big and was resulting database failure. In my localhost testing, it was causing this error

Function: ContentTranslation\TranslationStorageManager::update
Error: 2006 MySQL server has gone away (localhost)

With the old buggy retry logic,(https://gerrit.wikimedia.org/r/349214) this much big data was attempted to save several times, resulting a query that was repeated lot of time and taking lot of network.

With https://gerrit.wikimedia.org/r/350408 and https://gerrit.wikimedia.org/r/349214 the issue was not observed.

Change 350408 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Fix the container calculation for template editor

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

Change 351835 had a related patch set uploaded (by KartikMistry; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@wmf/1.29.0-wmf.21] Fix the container calculation for template editor

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

Change 351835 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@wmf/1.29.0-wmf.21] Fix the container calculation for template editor

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

Mentioned in SAL (#wikimedia-operations) [2017-05-09T13:25:53Z] <hashar@tin> Synchronized php-1.29.0-wmf.21/extensions/ContentTranslation/modules/tools/ext.cx.tools.template.js: Fix the container calculation for template editor - T163105 (duration: 00m 40s)

KartikMistry closed this task as Resolved.May 31 2017, 6:13 AM