(Go: >> BACK << -|- >> HOME <<)

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
Screen Shot 2018-07-12 at 4.42.49 PM.png (246×1 px, 105 KB)
Screen Shot 2018-07-12 at 4.42.28 PM.png (201×825 px, 88 KB)

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):

Screen Shot 2018-07-12 at 4.49.05 PM.png (450×919 px, 51 KB)

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)

Screen Shot 2018-07-12 at 4.58.03 PM.png (529×587 px, 113 KB)

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:

Related Objects

Event Timeline

Pginer-WMF triaged this task as Medium 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

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

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 subscribed.

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

Screen Shot 2018-09-06 at 3.47.56 PM.png (291×879 px, 69 KB)

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

Screen Shot 2018-09-06 at 3.48.09 PM.png (386×1 px, 67 KB)

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.

@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:

Screen Shot 2018-09-10 at 2.46.34 PM.png (584×860 px, 194 KB)

Compare with cx1:

Screen Shot 2018-09-10 at 2.47.08 PM.png (394×888 px, 168 KB)

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 differentiates 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
Screen Shot 2018-09-30 at 1.44.20 PM.png (223×862 px, 68 KB)
Screen Shot 2018-09-30 at 1.54.09 PM.png (313×952 px, 36 KB)
No errors
wmf.23 v2 enabled
Screen Shot 2018-09-30 at 1.45.09 PM.png (175×863 px, 55 KB)
Screen Shot 2018-09-30 at 1.51.49 PM.png (247×949 px, 42 KB)
Uncaught TypeError: Cannot read property 'emit' of null
Book referenceEdit book referenceConsole errors when click on the ref
cx2-testing
Screen Shot 2018-09-30 at 2.00.04 PM.png (138×861 px, 42 KB)
Screen Shot 2018-09-30 at 2.06.06 PM.png (317×956 px, 31 KB)
Uncaught TypeError: Cannot read property 'element' of null
wmf.23 v2 enabled
Screen Shot 2018-09-30 at 2.00.32 PM.png (158×848 px, 63 KB)
Screen Shot 2018-09-30 at 2.05.49 PM.png (328×948 px, 39 KB)
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
Screen Shot 2018-09-30 at 2.19.54 PM.png (194×865 px, 58 KB)
Screen Shot 2018-09-30 at 2.20.05 PM.png (330×960 px, 28 KB)
No errors
wmf.23 v2 enabled
Screen Shot 2018-09-30 at 2.25.37 PM.png (180×865 px, 46 KB)
Clicking on 'Edit' does not open the edit boxUncaught TypeError: Cannot read property 'getModel' of null

@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
cite-news-context-item.png (940×1 px, 165 KB)
cite-news-editing-dialog.png (943×1 px, 28 KB)

@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):

Screenshot 2019-03-05 at 13.11.15.png (498×1 px, 191 KB)

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
cite-news-context-item.png (940×1 px, 165 KB)
cite-news-editing-dialog.png (943×1 px, 28 KB)

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 turned out to be more serious than), which is outside the scope of this task.