Last modified: 2007-05-03 06:09:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9958, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7958 - Special:cite of older version of an article should use old version id
Special:cite of older version of an article should use old version id
Product: MediaWiki extensions
Classification: Unclassified
Cite (Other open bugs)
All All
: High major with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: 9422 9751 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2006-11-17 11:30 UTC by schosch
Modified: 2007-05-03 06:09 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

SkinTemplate patch for review (886 bytes, patch)
2007-05-02 05:31 UTC, Nick Jenkins
SkinTemplate patch for review, v2 (920 bytes, patch)
2007-05-02 05:52 UTC, Nick Jenkins
Alternate patch using $wgOut->mRevisionId (1.88 KB, patch)
2007-05-02 20:59 UTC, Brion Vibber

Description schosch 2006-11-17 11:30:51 UTC
"Cite this article" of older versions of an article does not work.

"Cite this article" of gives:
if I open an older version of this article, for example
then "Cite this article" still gives the reference to the current version, but
should give:

This should work, otherwise somebody not knowing the wikipedia will have
problems with correct citation of an older version of a wikpedia article

Greetings, Schusch
Comment 1 schosch 2006-11-17 11:48:43 UTC
(maybe another bug? just as information: i also had the problem some minutes
ago, that i got as citation an old version id for a current article - the
version was about one day old - with the article "castle" on en-WP. I got a
citation of id=88043269, but the current id is (and was) 88314504. I did a
refresh with my browser and got the current id - the id perhaps shouldn't be
cached? Schusch)
Comment 2 Rob Church 2007-03-26 23:29:08 UTC
*** Bug 9422 has been marked as a duplicate of this bug. ***
Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-05-01 17:16:23 UTC

*** This bug has been marked as a duplicate of 9751 ***
Comment 4 Brion Vibber 2007-05-01 17:42:46 UTC
*** Bug 9751 has been marked as a duplicate of this bug. ***
Comment 5 Nick Jenkins 2007-05-02 05:31:16 UTC
Created attachment 3558 [details]
SkinTemplate patch for review

Explanation / tech notes / summary:
* $oldid is the literal oldid parameter from the GET string, and it can be
misleading, such as when paging through results ( example:
is not actually revision 109148624 at all)
* The $revid parameter on the other hand is always equal to the most recent
revision ID, and so it cannot be used for citations of old versions either.
* Also the "permanent link" implementation currently avoids this whole problem
by being greyed out when oldid is set, therefore you can't look to it for help
* Instead, the attached uses the $wgArticle global, and just asks it what
revision_id it thinks it has, and sets the $revid equal to that.
* As a side-effect, this should also make "Permanent link" work /
non-greyed-out when paging through the previous revisions (it's not available
currently - example:
Comment 6 Nick Jenkins 2007-05-02 05:52:25 UTC
Created attachment 3559 [details]
SkinTemplate patch for review, v2

Small update to the previous patch, which would die with this error:
Fatal error: Call to a member function getId() on a non-object in
includes/SkinTemplate.php on line 855
When attempting to view an image page:

The attached version does not have this problem.
Comment 7 Brion Vibber 2007-05-02 14:57:34 UTC
The output/skin system already knows what id is being actually viewed in order
to make its edit link properly. That information should thus be available to
both the permalink (which should be showing, *not* grayed out) and Special:Cite

If the wrong revision id number is being passed somewhere, perhaps that should
be fixed?
Comment 8 Brion Vibber 2007-05-02 14:58:52 UTC
Errr. ok that's what the patch does. Yay!
Comment 9 Brion Vibber 2007-05-02 20:59:07 UTC
Created attachment 3565 [details]
Alternate patch using $wgOut->mRevisionId

The previous patch does not appear to work correctly for current revision
views, as with the parser cache enabled the revision row is not actually loaded
when not needed.

This alternate patch uses the existing Skin/$wgOut-based revision ID record,
and additionally sets it to the current revision for parser cache hits (where
it was not previously needed, since it was only used to feed to parser objects
to fill the {{REVISIONID}} variable.)
Comment 10 Nick Jenkins 2007-05-03 06:09:36 UTC
Looks good, applied in r21819.

> patch uses the existing Skin/$wgOut-based revision ID record

Only one-line addition to the above was to add the explicit declaration 
for $mRevisionId - without it, it was not obvious to me that Skin
already knew the revision ID all along, but just in an undeclared data

Marking as resolved.

Note You need to log in before you can comment on or make changes to this bug.