Page MenuHomePhabricator

{{REVISIONID}} and related magic words should not be blank after doing a null edit
Closed, ResolvedPublic

Description

Author: c1541

Description:
First create a page with the following:

  • {{REVISIONUSER}}
  • {{REVISIONTIMESTAMP}}

Is will show some data.

However, if a null edit is then done on the page, it doesn't show anything as {{REVISIONUSER}} & {{REVISIONTIMESTAMP}} are blank rather than the user & time of the last edit before the null edit.

A purge will then make the correct values be shown.


Version: 1.18.x
Severity: normal

Details

Reference
bz32948

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:00 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz32948.
bzimport added a subscriber: Unknown Object (MLST).

Null edit in what way? Does this edit create a new revision?

A null edit is a save without changes (See [[Wikipedia:NULLEDIT]]). That produce no new new revision in the history, but it should not destroy the REVISION* variable.

Under 1.18 all REVISION*-vars are empty. With 1.19 only REVISIONID and REVISIONUSER are empty, but the other REVISION* are using the timestamp of the nulledit and not the Revision timestamp.

Using the api with action=purge&forcelinkupdate= shows the same behaviour as nulledit, but without forcelinkupdate it is all right. This means a LinkUpdate is not setting the right revision timestamp in its parse context.

This is breaking pages with code like this:

Last updated by {{User|{{REVISIONUSER}}}} on {{#time:r|{{REVISIONTIMESTAMP}}}} ({{purge}}).

Such as:
https://commons.wikimedia.org/wiki/User:Krinkle/Testcase/1
https://commons.wikimedia.org/wiki/Commons:Auto-protected_files/wikipedia/en

It seems to also affect bot-edits. When a bot edits the 2nd page listed above it also results in those magic words being empty.

Assuming this fix also fixes it for bots, can this please be backported to 1.18wmf1 ?

Looks like the bot was also doing a null edit sometimes. Fixed :)