Page MenuHomePhabricator

Option to start from scratch results in a scroll jump and "Machine translation failed" error
Closed, ResolvedPublic

Description

When translating Lemonade from English to Finnish, adding the first paragraph and selecting the option to "Start with an empty paragraph" causes the following issues:

  • Scroll jumps to the top of the document.
  • A "Machine translation failed" error is shown to the user.
  • The MT card shows the previous service ("Google" in the example).

The issue is illustrated below:

Oct-02-2019 11-00-59.gif (291×640 px, 3 MB)

The Javascript console error is included below:

Uncaught TypeError: Cannot read property 'getChildren' of null
    at MwCXTranslationTracker.mw.cx.TranslationTracker.isExcludedFromValidation (<anonymous>:900:34)
    at MwCXTranslationTracker.mw.cx.TranslationTracker.processValidationQueue (<anonymous>:899:494)
    at VeCeCXSectionNode.OO.EventEmitter.emit (<anonymous>:74:483)
    at HTMLElement.dispatch (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=rudzv:69)
    at HTMLElement.elemData.handle (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=rudzv:65)
    at remove (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=rudzv:77)
    at jQuery.fn.init.detach (load.php?lang=en&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=rudzv:79)
    at VeCeDocumentNode.ve.ce.BranchNode.onSplice (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1utuv:380)
    at VeDmDocumentNode.OO.EventEmitter.emit (<anonymous>:74:483)
    at VeDmDocumentNode.ve.dm.BranchNode.splice (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1utuv:71)

Event Timeline

@Doc_James - For your reference related to the report sent from Wikiproject Medicine. Thanks.

Change 543019 had a related patch set uploaded (by Petar.petkovic; owner: Petar.petkovic):
[mediawiki/extensions/ContentTranslation@master] Add more checks for section model being null

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

Change 543019 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Add more checks for section model being null

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

I tried the same steps from the description and only got Javascript errors being logged in console.
Message "Machine translation failed" was not shown and jump did not happen.

Also tried steps with different articles and language pairs on both production and localhost. @Jpita, @Pginer-WMF can you recheck if jump still happens? I also saw some jumps happening in the past, but I don't know when the last time was.

Also tried steps with different articles and language pairs on both production and localhost. @Jpita, @Pginer-WMF can you recheck if jump still happens? I also saw some jumps happening in the past, but I don't know when the last time was.

The jump does no longer happen for me. I selected different options on the MT card with the viewport at different positions and was not able to reproduce the jump. Before it was very hard not to find it, so I guess it no longer happens. But @Jpita, feel free to do further checks.

Also tried steps with different articles and language pairs on both production and localhost. @Jpita, @Pginer-WMF can you recheck if jump still happens? I also saw some jumps happening in the past, but I don't know when the last time was.

The jump does no longer happen for me. I selected different options on the MT card with the viewport at different positions and was not able to reproduce the jump. Before it was very hard not to find it, so I guess it no longer happens. But @Jpita, feel free to do further checks.

I also did checks using various viewport positions and MT options.