From: Antoine Musso Date: Mon, 16 Jan 2006 18:34:11 +0000 (+0000) Subject: Fix #1122: "older revision" link displayed when viewing first revision of an article X-Git-Tag: 1.6.0~510 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=88149ad3ae38aa4f0b3dc9cd32e3748252910970;p=lhc%2Fweb%2Fwiklou.git Fix #1122: "older revision" link displayed when viewing first revision of an article --- 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 );