From 88149ad3ae38aa4f0b3dc9cd32e3748252910970 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 16 Jan 2006 18:34:11 +0000 Subject: [PATCH] Fix #1122: "older revision" link displayed when viewing first revision of an article --- RELEASE-NOTES | 1 + includes/Article.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6908afcce4..7e0a465502 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -518,6 +518,7 @@ fully support the editing toolbar, but was found to be too confusing. For typical usage this will be a light burden and should reduce confusion when the configuration is edited. * Fix $wgCacheEpoch's effect on client-side caching. +* (bug 1122) gray out 'older revision' when viewing first article revision. === Caveats === diff --git a/includes/Article.php b/includes/Article.php index 82891fc7bc..66fbc2c700 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2231,7 +2231,11 @@ class Article { } /** - * @todo document this function + * Generate the navigation links when browsing through an article revisions + * It shows the information as: + * Revision as of ; view current revision + * <- Previous version | Next Version -> + * * @access private * @param string $oldid Revision ID of this article revision */ @@ -2244,7 +2248,10 @@ class Article { $lnk = $current ? wfMsg( 'currentrevisionlink' ) : $lnk = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'currentrevisionlink' ) ); - $prevlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid ); + $prev = $this->mTitle->getPreviousRevisionID( $oldid ) ; + $prevlink = $prev + ? $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid ) + : wfMsg( 'previousrevision' ); $nextlink = $current ? wfMsg( 'nextrevision' ) : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'nextrevision' ), 'direction=next&oldid='.$oldid ); -- 2.20.1