Page MenuHomePhabricator

When using {{REVISIONTIMESTAMP:pagename}} in a template, it displayed as local time
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  1. login test.wikipedia.org
  2. Open [[Special:Preferences]]
  3. Goto 'Appearance' tab
  4. Set 'Time offset' as a time zone (non 'Use wiki default (UTC)')
  5. Click 'Save'
  6. Create page, see https://test.wikipedia.org/wiki/REVISIONTIMESTAMP_test. At this point the timestamp displayed by {{REVISIONTIMESTAMP:REVISIONTIMESTAMP test}} is server time
  7. Create another page: https://test.wikipedia.org/wiki/REVISIONTIMESTAMP_test/1, Content is '{{:REVISIONTIMESTAMP test}}', At this point the timestamp displayed by {{REVISIONTIMESTAMP:REVISIONTIMESTAMP test}} is local time

My test results ('Time offset' as 'Asia/Shanghai', UTC+8):
Content displayed in [[REVISIONTIMESTAMP_test]]:

REVISIONTIMESTAMP with pagename REVISIONTIMESTAMP test: 20221009035405

Content displayed in [[REVISIONTIMESTAMP_test/1]]:

REVISIONTIMESTAMP with pagename REVISIONTIMESTAMP test: 20221009115405

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

If edit [[REVISIONTIMESTAMP_test]] again, The {{REVISIONTIMESTAMP:REVISIONTIMESTAMP test}} timestamp displayed after refresh [[REVISIONTIMESTAMP test/1]] is the same as that of [[REVISIONTIMESTAMP_test]], both of which are server time.

After that if you edit [[REVISIONTIMESTAMP test/1]] again, the {{REVISIONTIMESTAMP:REVISIONTIMESTAMP test}} timestamp displayed by [[REVISIONTIMESTAMP test/1]] becomes local time again.

Possible commit that cause this: d08e0cdf209a764edd550651da551a93139fe64b
The last userAdjust() call didn't supply empty string as the second parameter as $parser->getRevisionTimestamp() does.

Change 840566 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] parser: Make the behavior of REVISIONTIMESTAMP consistent

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

PatchDemo seems to have fixed this issue

Change 840566 merged by jenkins-bot:

[mediawiki/core@master] parser: Make the behavior of REVISIONTIMESTAMP consistent

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

Hi. Re: Tech News (User-notice) - What wording would you suggest as the content (I.e. who does it affect, and what do they need to know, and what do they need to do)?
and When should it be included (I.e. If it should be in this Monday's edition, then we need wording before ~24hours from now when it will be frozen for translation) ? Thanks!

I don't think this needs a user notice, it's just a small recent mistake and was fixed quickly. We can even close this if nothing needs to do on the Parsoid side.

There still seems to be some problems. In edit mode, {{REVISIONTIMESTAMP}} displays the current time in the preview and edit notile, not the edit time of the last revision.

see https://test.wikipedia.org/w/index.php?title=REVISIONTIMESTAMP_test/6&action=edit

There still seems to be some problems. In edit mode, {{REVISIONTIMESTAMP}} displays the current time in the preview and edit notile, not the edit time of the last revision.

I believe this is the expected behaviour, tested on the previous version and that's how the preview works.

在T320338#8334665中,@Func写道:

I believe this is the expected behaviour, tested on the previous version and that's how the preview works.

The previous version was not like this. Used {{REVISIONTIMESTAMP}} on edit notice for several years in zhwiki. The problem has only recently occurred. see:
https://zh.wikipedia.org/w/index.php?title=Template:Itn&action=edit
https://zh.wikipedia.org/wiki/Template:ITN-Update

In edit mode, {{ITN-Update}} in edit notice shows "0 seconds ago"

oh, I see, for message parsing like edit notice, it shouldn't be in the current time.

Change 844560 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] parser: Fix revision timestamp when parsing messages

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

在T320338#8334846中,@gerritbot写道:

Change 844560 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] parser: Fix revision timestamp when parsing messages

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

@Func see https://patchdemo.wmflabs.org/wikis/640b962919/w/index.php?title=REVISIONTIMESTAMP_test&action=submit
still the current time

@Shizhao I only fix for edit notice. for preview, it's an intended change in 5cb4693 by @cscott

By the way, I am not sure from which version the behaviour of timestamp preview getting different with or without the page name, at least for 1.34 they are the same - current time.

ref: https://llwiki.org/mediawiki/index.php?title=User:Func/Sandbox&action=submit

after the patch, the timestamp will be real revision time in both modes for messages, e.g. edit notices.

在T320338#8337695中,@Func写道:

after the patch, the timestamp will be real revision time in both modes for messages, e.g. edit notices.

thx

The previous version was not like this. Used {{REVISIONTIMESTAMP}} on edit notice for several years in zhwiki. The problem has only recently occurred. see:
https://zh.wikipedia.org/w/index.php?title=Template:Itn&action=edit
https://zh.wikipedia.org/wiki/Template:ITN-Update

In edit mode, {{ITN-Update}} in edit notice shows "0 seconds ago"

Please help to extend the task description, I will extend the commit message.

Change 844560 merged by jenkins-bot:

[mediawiki/core@master] parser: Use the actual revision timestamp of the page for messages

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

Test wiki on Patch demo by Shizhao using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/f3c5e71f50/w/

Test wiki on Patch demo by Shizhao using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/640b962919/w/