Page MenuHomePhabricator

JavaScript errors when translating on CX
Closed, ResolvedPublic1 Story Points

Description

The title may sound generic, but it's indeed a problem that happens on a lot of sites and pages, essentially making CX broken in production.

To reproduce, Try to translate the article Кашира from ru to ba.

Click on some paragraphs and try to type - and it will be impossible, and there will be a JS error about templateData.

This happens when I try to transl articles from the Russian Wikipedia. Maybe it happens with other languages, too.

Event Timeline

Amire80 created this task.Apr 25 2015, 10:12 AM
Amire80 raised the priority of this task from to Unbreak Now!.
Amire80 updated the task description. (Show Details)
Amire80 added a project: ContentTranslation.
Amire80 added a subscriber: Amire80.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 25 2015, 10:12 AM

I can't reproduce it with

page=Каш&from=ru&to=ba&targettitle=Каш

Now, I can:

Uncaught TypeError: Cannot read property 'length' of undefined

At, ext.cx.tools.template.js:139

if ( !this.templateData || this.templateData.parts.length > 1 ) {

KartikMistry lowered the priority of this task from Unbreak Now! to High.Apr 27 2015, 4:14 AM
KartikMistry set Security to None.
KartikMistry added subscribers: santhosh, Nikerabbit.

Change 206751 had a related patch set uploaded (by KartikMistry):
Only use templateData when not null

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

I can't reproduce it with

page=Каш&from=ru&to=ba&targettitle=Каш

It is page=Кашира&from=ru&to=ba&targettitle=Каш

page=Кашира&from=ru, in its first paragraph there is a template named Население that render the text 40 213[1]. In this the reference fragment is not a template and does not have template data.

santhosh claimed this task.Apr 28 2015, 5:12 AM
santhosh edited a custom field.Apr 28 2015, 5:42 AM
santhosh moved this task from In Progress to In Review on the LE-Sprint-86 board.

Change 206751 merged by jenkins-bot:
Check if template fragments are of type mw:Transclusion before processing

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

KartikMistry moved this task from In Review to Done on the LE-Sprint-86 board.Apr 28 2015, 3:06 PM
KartikMistry closed this task as Resolved.Apr 28 2015, 4:25 PM