Page MenuHomePhabricator

CX2: Improve support for different types of references
Closed, ResolvedPublic

Description

Content Translation does not differentiate between different types of references (cite book, cite web, cite IETF etc) - they are all marked as Reference. You can see the difference between Content Translation and Visual Editor for the same reference:

"Reference" in Content Translation"Book" in Visual Editor

More importantly than the label being different, the support for editing these references is also different. Specific types of references have specific dialogs to edit them, which are not used when those references are edited in Content Translation.

For example, on the ContentTranslation clicking on Edit will display the Basic Reference inspector (not template-based dialog):

In VE there will be different, template-based editing dialogs, e.g. if the above reference will be edited on the page (en:Transport Layer Security)

The expected behaviour is for Content Translation to work as Visual Editor does in this regard: showing the specific dialog for editing specific types of references. That would make the experience more consistent and make dialogs more appropriate to the data being edited.


Reported based on the info from T198390#4421534

Related tickets:

Details

Related Gerrit Patches:

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 13 2018, 8:42 AM
Pginer-WMF triaged this task as Normal priority.Jul 13 2018, 9:15 AM

A screencast showing how this works

Change 449167 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Support adapting Cite web,journal,book.. templates in references

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

Nikerabbit updated the task description. (Show Details)Jul 31 2018, 8:18 AM
santhosh claimed this task.Jul 31 2018, 8:48 AM

Change 449167 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Support adapting Cite web, journal, book.. templates in references

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

Petar.petkovic removed a project: Patch-For-Review.
Petar.petkovic removed a subscriber: gerritbot.
Stashbot added a subscriber: Stashbot.

Mentioned in SAL (#wikimedia-operations) [2018-08-08T06:13:44Z] <kartik@deploy1001> Started deploy [cxserver/deploy@6a0cab1]: Update cxserver to 951fdba (T199308, T199512, T199320, T200665, T200453, T106437)

Mentioned in SAL (#wikimedia-operations) [2018-08-08T06:17:16Z] <kartik@deploy1001> Finished deploy [cxserver/deploy@6a0cab1]: Update cxserver to 951fdba (T199308, T199512, T199320, T200665, T200453, T106437) (duration: 03m 32s)

Etonkovidova closed this task as Resolved.EditedSep 6 2018, 10:49 PM
Etonkovidova added a subscriber: Etonkovidova.

Re-opened the ticket since the fix works only for the references that are inserted manually into translation - the references from source article that will be translated with MT/source options are still displayed as Basic references. @santhosh - please let me know if I get the specs from the ticket right. Should the issue with MT/source translated references be fixed?

Checked the case when a user manually inserts different types of references into translation:

  • Book, News, Website etc accordingly

  • when editing the inserted reference, the specific form will be used.

Etonkovidova reopened this task as Open.Sep 7 2018, 12:52 AM

The basic editor or specific editor for cite type depends the configuration in VE for target language wiki. https://en.wikipedia.org/wiki/MediaWiki:Citoid-template-type-map.json

I can see if those conditions are satisfied if language pair info, the article and the wiki were this testing happend is shared. Not all target languages has this citoid configuration.

Etonkovidova added a comment.EditedSep 10 2018, 9:13 PM

@santhosh I could not find a lang pair for which ref translation works. Also, I tried translation with the source option (it seems to be the case in Kazam_screencast_00006.mp4 screencast) - the references are still the same.

Some regression issue is here? Translating the first paragraph in en:Victoria Island (Canada) article to es using the source option:

Compare with cx1:

Presently there are Console errors when any reference is clicked:

Uncaught TypeError: Cannot read property 'element' of null
    at VeCeCXTransclusionInlineNode.ve.ce.View.initialize 
    at VeCeCXTransclusionInlineNode.ve.ce.LeafNode.initialize     
    at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.render     
    at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.render 
    at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.doneGenerating

and

Uncaught TypeError: Cannot read property 'emit' of null
   at VeCeCXTransclusionInlineNode.ve.ce.CXTransclusionInlineNode.afterRender 
   at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.render     
   at VeCeCXTransclusionInlineNode.ve.ce.MWTransclusionNode.render 
   at VeCeCXTransclusionInlineNode.ve.ce.GeneratedContentNode.doneGenerating

Clicking on 'Edit' a reference produce the following error:

Uncaught TypeError: Cannot read property 'getModel' of null
   at VeUiMWReferenceDialog.
   at OO.ui.Process.execute
   at VeUiMWReferenceDialog.OO.ui.Window.teardown

@Pginer-WMF - please review the following results of comparative reference testing
(1) The issues related to references and the Console errors associated with them have been reported across several tickets:

In QA column: T202165: Content translation: Problem with handling references...
T205420: CXServer fails with HTTP 500: "MT processing error: undefined"
T205429: CX2: Uncaught TypeError: Cannot read property 'element' of null at VeCeCXTransclusionInlineNode.ve.ce.View.initialize (ve.ce.View.js?9c8a2:109)
In QA column: T205521: Working with references is broken in CX2

This task - T199512 - can be made a tracking ticket of all the above since it is the first ticket that describes the required functionality

(2) There is a significant difference in a way how cx2 and the production (wmf.24 with v2 enabled) handle the references.
All examples in the table below are from en:Victoria island (Canada) being translated to Catalan with Apertium.

To summarize:

  • cx2 does not differentiate between different types of references, but displays them correctly using the source reference.
  • wmf.23 differentiate between different types of references, but they are displayed with many omissions
  • The Console consistently displays errors
Web site referenceEdit Website referenceConsole errors when click on the ref
cx2-testing
No errors
wmf.23 v2 enabled
Uncaught TypeError: Cannot read property 'emit' of null
Book referenceEdit book referenceConsole errors when click on the ref
cx2-testing
Uncaught TypeError: Cannot read property 'element' of null
wmf.23 v2 enabled
Uncaught TypeError: Cannot read property 'emit' of null

"Cite news" presents even bigger problem in production - if 'Edit' reference is clicked, nothing happens, a page becomes frozen, the Console displays the error: Uncaught TypeError: Cannot read property 'getModel' of null

Cite newsEdit cite news referenceConsole errors when click on the ref
cx2-testing
No errors
wmf.23 v2 enabled
Clicking on 'Edit' does not open the edit boxUncaught TypeError: Cannot read property 'getModel' of null
Pginer-WMF updated the task description. (Show Details)Oct 1 2018, 2:13 PM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF moved this task from QA to In Progress on the Language-2018-July-September board.EditedOct 1 2018, 2:27 PM

@Pginer-WMF - please review the following results of comparative reference testing

Thanks for checking and the detailed report. I moved this back into development since there are cases where editing the references causes errors.

For this task, the focus is to make specific references work in production. For the same support on our testing servers (which would be desirable), we may need a separate ticket once the cause for the difference in behaviour is figured out.

I have tried examples from @Etonkovidova's comment in T199512#4629883. Haven't tried on cx2-testing, only in production. Article en:Victoria island (Canada) was used for website reference and book reference. There are no console errors when clicking on references and appropriate dialogs are shown for editing.

For "Cite news", there is no information which article @Etonkovidova used, so I tried en:Pioneer_Square_pergola. I translated section starting with "The Victorian-style" and tried editing references which are coming from "Cite news" and the editor opens without any console error. In that section, there is one "Cite web" and four "Cite news" templates. That one "Cite web" displays custom label "Lloc web" inside context item and appropriate dialog for editing web references. Those four "Cite news" templates have generic "Referència" label in context item and generic reference editing dialog is opened. Inside that dialog, there is invisible template "Ref-notícia". Opening the dialog to edit that template reveals there are no editable parameters that are shown for that reference (like title, first and last name of the author, etc.), only the option to add new params.

Cite news context itemCite news editing dialog

@Pginer-WMF with this new information, how do you want to proceed with this ticket? We can create separate ticket for "Cite news" references and send this one back to QA, as @Etonkovidova might want to do further testing.

@Pginer-WMF with this new information, how do you want to proceed with this ticket? We can create separate ticket for "Cite news" references and send this one back to QA, as @Etonkovidova might want to do further testing.

I checked how the "Ref-notícia" is edited in Visual editor with an article in Catalan Wikipedia which used such template, and it seems that a custom form is also not present there (probably because of the lack of metadata):

So I think there is not much we can do to support better this particular kind of reference template. The situation is more problematic in Content translation because of some existing issues with references that contribute to the problem to go unnoticed (and we may want to fix):

Etonkovidova closed this task as Resolved.EditedMar 22 2019, 8:56 PM

I re-checked 1.33.0-wmf.22 for my examples and the examples that @Petar.petcovic provided in the following comment (sorry I did not provide articles' titles for my examples).

For "Cite news", there is no information which article @Etonkovidova used, so I tried en:Pioneer_Square_pergola. I translated section starting with "The Victorian-style" and tried editing references which are coming from "Cite news" and the editor opens without any console error. In that section, there is one "Cite web" and four "Cite news" templates. That one "Cite web" displays custom label "Lloc web" inside context item and appropriate dialog for editing web references. Those four "Cite news" templates have generic "Referència" label in context item and generic reference editing dialog is opened. Inside that dialog, there is invisible template "Ref-notícia". Opening the dialog to edit that template reveals there are no editable parameters that are shown for that reference (like title, first and last name of the author, etc.), only the option to add new params.

Cite news context itemCite news editing dialog

Except for the issue with {cite news} , other references types seem to be sufficiently supported.
Given that additional phab tasks are filed, I am closing this task as Resolved.

Note: I looked more into the Console errors that I reported in my comment. In T219035 the existing case is reported (the issue looked more serious than it turned out to be), which is outside the scope of this task.