Page MenuHomePhabricator

Sections that are published as "new" sections have duplicate section title
Open, HighPublicBUG REPORT

Description

What happens?:

When a non-lead section is being published using the Section Translation application, a payload with the required parameters are submitted to the backend ContentTranslation API. One such required parameter is the sectionnumber parameter, which holds the position of the section among all sections inside the target article.

The value of the sectionnumber parameter is calculated by SX, according to the following logic:
a. If any appendix section (e.g. "References", "Notes", "See also", etc) exists inside the target article, the section should be positioned just before the first appendix section. In this case the sectionnumber will be a positive number indicating the index (position) of the first appendix section among all target section titles.
b. If no appendix sections exist, then the section should be published at the bottom of the target article, and the sectionnumber will be a string with value "new".
c. If the section is published to the user sandbox (i.e. when the publish option is set to "Publish to your Sandbox"), then it should be also published at the bottom of the sandbox page, and thus the sectionnumber will again be a string with value "new".

However, when the sectionnumber is "new", that is for the cases (b) and (c), and after the section is published, the section appears to have a duplicate section title, as demonstrated in the screencast and screenshot below:

Screencast of section translation when target article has no appendix titles (case b). As displayed in the video, the light blue section placeholder inside the "Full article in 'target language'" tab in "Compare contents" step, is positioned at the bottom of the target article.

Screenshot of newly published section in user namespace.

sandbox-published.png (852×398 px, 78 KB)

Steps to replicate the issue
Since the root cause of the issue is the same for both (b) and (c) cases, it can be considered enough to test only one of these cases.

In order to test case (b), the following steps should be followed:

  1. Translate an existing section, for a target article is considered by SX to not have any appendix sections. An example of such a target article is Οράνιεστατ (Αρούμπα) in Greek Wikipedia. To replicate the issue for the specific article you should translate the Oranjestad, Aruba article from English to Greek (Ελληνικά).
  2. Publish the translated section with publish option set to "Publish as a new section" (which is the default).
  3. Check that the section title of the published section appears twice.

In order to test case (c), the following steps should be followed:

  1. Translate any section using SX.
  2. Inside "Preview and Publish" step (which is the last step of the publishing process) click the "cog" icon and select the "Publish to your Sandbox" option.
  3. Publish the translation.
  4. Check that the section title of the published section appears twice.

What should have happened instead?:
The section title of the published section should appear only once.

Event Timeline

ngkountas triaged this task as High priority.
ngkountas added a project: CX-mobile.

Change 828757 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX: Move section title prepending to server-side

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

Change 828757 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX: Move section title prepending to server-side

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

Test status: QA PASS

Able to translate section with observing the duplicate section titles after publishing

Pginer-WMF subscribed.

Test status: QA PASS

Able to translate section with observing the duplicate section titles after publishing

My understanting is that:

  • The ticket is about expanding an article by translating a new section. Not creating a new article by translating the lead section.
  • The QA video shows how an a new article is created by translating their lead section.

The case to verify should be when translating a non-lead section. Moving back to QA, but please let me know if I was misinterpreting something.

Tested the scenario where it will be added to an aritcle by creating a new section.

Let me know if this suffices the aforementioned test scenario.

Tested the scenario where it will be added to an aritcle by creating a new section.

Let me know if this suffices the aforementioned test scenario.

Based on the video, you were trying to expand the article with one new section, but the contents went to the lead section instead. Is my reading of the video correct?
If that is the case, the contents are not placed as expected in the target article. @ngkountas is this particular case a known issue?