Page MenuHomePhabricator

[BUG] Cannot load page summary in page preview dialog if contains language code prefix
Closed, ResolvedPublicBUG REPORT

Description

Steps to reproduce

  1. Change search language to zh-hant (Traditional Chinese)
  2. Search A taxi driver and click the first search result 我只是個計程車司機
  3. In the article page, click on the Korean name link to open the preview dialog

Demo: https://youtu.be/UaC64l_BLts

Fullscreen_2_5_18__9_21_AM.png (1×707 px, 643 KB)
Cannot show page summary which contains language code prefix in zh-hant
Fullscreen_2_5_18__9_22_AM.png (1×712 px, 405 KB)
Cannot show page summary which contains language code prefix in Japanese
Fullscreen_2_5_18__9_19_AM.png (1×1 px, 858 KB)
Desktop reference

Expected

Able to see the page summary event it contains the language code prefix.

Actual

Show "This page does not exist"

Event Timeline

Restricted Application added subscribers: Stang, revi, Aklapper. · View Herald Transcript

Just a note for this ticket:
After doing some investigation on the PageTitle.java, looks like the following method does not handle language code correctly.

public String getPrefixedText() {
    return namespace == null ? getText() : StringUtil.addUnderscores(namespace) + ":" + getText();
}

Change 408957 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[apps/android/wikipedia@master] Fix: Cannot load page summary if the link contains language code

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

Looks like the language codes are in two-digits format, maybe it is a simplest way to avoid the errors.
Reference: https://countrycode.org/

But, it may still have potential issues if the API send us a two-digits special namespace which is not a language code...

Change 408957 merged by jenkins-bot:
[apps/android/wikipedia@master] Fix: Cannot load page summary if the link contains language code

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

Restricted Application changed the subtype of this task from "Task" to "Bug Report". · View Herald TranscriptNov 13 2021, 11:36 PM