Page MenuHomePhabricator

{{REVISIONID}} is broken until page is purged
Closed, ResolvedPublic

Description

Author: gangleri

Description:
Hallo!

sceen dump from http://yi.wiktionary.org/wiki/user_talk:Gangleri follows

{{REVISIONID}} is broken. Before {{REVISIONID}} was showing 0 in preview which
was fine for me.

Now {{REVISIONID}} will not show in preview any more *and* it will not show
after saving *unless* the page is purged. This makes no sense to me.

Tray to edit
http://en.wikipedia.org/wiki/User:Gangleri/tests/REVISIONID
or
http://test.leuksman.com/view/User:Gangleri/tests/REVISIONID
making minor changes. Just add some dots at the end and save.

If you see a red {{REVISIONID}} tray to purge the page.

regards reinhardt [[user:gangleri]]


Version: unspecified
Severity: normal
URL: http://en.wikipedia.org/wiki/User:Gangleri/tests/REVISIONID

Details

Reference
bz3979

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:54 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz3979.
bzimport added a subscriber: Unknown Object (MLST).

gangleri wrote:

screen dump for bug 03979

Attached:

bugzilla_03979_001.jpg (331×240 px, 19 KB)

gangleri wrote:

*note*
{{REVISIONID}} originaly designed as a variable
see
http://meta.wikimedia.org/w/index.php?title=Help:Variable&oldid=222594#Depending_on_revision
is now shown in
"Templates used on this page:"

zocky wrote:

This makes {{REVISIONID}} useless until it's fixed.

tietew-mediazilla wrote:

{{REVISIONID}} fix patch

attachment revisionid.patch ignored as obsolete

Patch doesn't appear to fix the bug. It seems to cause it to show '0' instead of a
'Template:REVISIONID' link, but it still is storing the wrong version number in the
parser cache: 0 for new pages, and the previous revision for edited pages.

A correct fix probably will require updating the article's ID number after the revision
is saved and before the text is parsed (which goes to the link cache and, now, gets
saved in the parser cache.)

Removing patch keywords for the moment, as patch doesn't fix the problem.

Created attachment 1105
Patch to Parser.php, Article.php, OutputPage.php

This patch:

  • Removes $wgArticle dependency from Parser's {{REVISIONID}} handling
  • Adds an optional parameter on Parser::parse() for revision id
  • Wraps that with OutputPage::setRevisionId()
  • Adds appropriate calls on Article::view and Article::showArticle, which

passes the newly inserted id number from page save

It seems to properly handle both page creation and update. Also it will be an
easy way for special pages which deal with external-page text to poke in a
revision id number.

attachment 3979.diff ignored as obsolete

Created attachment 1106
Patch to Parser.php, Article.php, OutputPage.php, DifferenceEngine.php

Compared to previous version:

  • Removes hook for revision ID override, can now set that directly
  • Removes debugging statements ;)
  • Sets revision ID in diff rendered-text display

Attached: