Page MenuHomePhabricator

Some translations can't be published after deploying the new CX template editor and give docserver-http: HTTP 400
Closed, ResolvedPublic

Description

I tested template translation after the deployment on Thursday December 1 2016.

I couldn't publish a translation from Hebrew to Spanish or French. I repeatedly got "docserver-http: HTTP 400".

It worked correctly when translating from English or Catalan into Spanish.

I tried the article "מגדל שלום מאיר" and several others.

Event Timeline

Do you have the title of the article on the target wiki?

The title of the article in the target wiki is "Usuario:Amire80/Migdal Shalom 12-5-1" (in the user namespace, "Usuario").

I tried this again today December 5 at 09:39 AM UTC.

I received several other complaints about it. One on Talk:CX: https://www.mediawiki.org/wiki/Topic:Tgh3cf65cf0upl26. It says that the user could not translate H. M. S. Richards to Spanish, and this means that it is not unique to Hebrew. I received a couple of other complaints over email.

Amire80 renamed this task from Translation from Hebrew to Spanish doesn't work: docserver-http: HTTP 400 to Some translations can't be published after deploying the new CX template editor and give docserver-http: HTTP 400.Dec 5 2016, 9:43 AM
Amire80 triaged this task as High priority.

I received a couple of other complaints over email.

Can you please list the articles with the language pairs on this ticket?

I am able to reproduce this and it is independent of language or title. I got the smallest HTML snippet that can cause the parsing system failure

<span about="#mwt5" class="mw-ref" id="cxcite_ref-2" rel="dc:references" typeof="mw:Transclusion  mw:Extension/ref"></span>

Just paste this html in HTML field of https://ml.wikipedia.org/api/rest_v1/#!/Transforms/post_transform_html_to_wikitext_title_revision - 400 is guaranteed.
This HTML snippet was output of Yandex MT. data-mw is missing.

I also found that removing mw:Transclusion from typeof attribute makes the parser working

<span about="#mwt5" class="mw-ref" id="cxcite_ref-2" rel="dc:references" typeof="mw:Extension/ref"></span>

That also mean the following snippet is enough to create 400

<span typeof="mw:Transclusion"></span>

And this is expected behavior from parsoid https://github.com/wikimedia/parsoid/blob/master/tests/mocha/api.js#L1231

So from CX, we should avoid creating HTML without data-mw if typeof=mw:Transclusion

Change 325520 had a related patch set uploaded (by Santhosh):
For unadapted inline templates, ensure data-mw even after MT

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

Change 325520 merged by jenkins-bot:
For unadapted inline templates, ensure data-mw even after MT

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