Page MenuHomePhabricator

[Bug] mobile-html edit history is undefined
Closed, ResolvedPublicBUG REPORT

Description

Impact: The view edits history subtitle shows undefined for any page updated 2 or more days ago.

Steps to Reproduce:

  1. Open any English mobile-html page in dev environment, e.g. http://localhost:8888/en.wikipedia.org/v1/page/mobile-html/Cat
  2. In the browser DevTools JavaScript console add a Footer with editedDaysAgo specified
pcs.c1.Footer.add({
  title: 'Cat',
  menu: {
    items: [pcs.c1.Footer.MenuItemType.lastEdited],
    fragment: "pcs-menu",
    editedDaysAgo: 3
  },
  readMore: {}
})
  1. Observe the string in the subtitle under "View edit history"

Actual Results:
"undefined"

Expected Results:
"Updated 3 days ago"

Event Timeline

LGoto triaged this task as High priority.Apr 7 2020, 3:36 PM

Change 587344 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] Fix "updated x days ago" message

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

Change 587344 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Fix "updated x days ago" message

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

This will make all translations where singular (or the "first") form does not equal 1 wrong unless they manually add =1, which causes the same issue as English currently?

Alternative solutions would be to make separate messages for "Today" and "Yesterday" and "$1 days ago".

@Nikerabbit I've just checked editedDaysAgo parameter with values 1 for 'Yesterday' and 0 for 'Today'. It seems it works as expected.

last edit.png (688×594 px, 62 KB)

cc: @MSantos

MSantos claimed this task.

Thanks, @vadim-kovalenko.

Seems to be resolved. I'll be bold and resolve the task but please @Nikerabbit let us know if we are missing anything else.

I suggest to test:

  • Chinese (zh-Hant or zh-Hans) which does not have separate plural form, so by my reading the middle value in {{PLURAL:$1|更新于昨天|更新于$1天前|0=更新于今天}} is not reachable.
  • Macedonian (mk) with values like 1, 21, 31, 41, 51, 61 which may all show "yesterday" of {{PLURAL:$1|Подновено вчера|Подновено пред $1 дена|0=Подновено денес}}

There are also other languages but they have not yet updated their translations.