Don't show "older edit" when no older edit available. Based on patch by Umherirrender
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 1 Sep 2010 14:16:23 +0000 (14:16 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 1 Sep 2010 14:16:23 +0000 (14:16 +0000)
RELEASE-NOTES
includes/diff/DifferenceInterface.php

index 9053274..b3f45dc 100644 (file)
@@ -310,6 +310,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   when a resource limit such as $wgMaxShellMemory is hit.
 * (bug 24981) Allow extensions to access SpecialUpload variables again
 * (bug 20744) Wiki forgets about an uploaded file
+* (bug 17913) Don't show "older edit" when no older edit available
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index 9cbee31..3b7e3ed 100644 (file)
@@ -277,18 +277,22 @@ CONTROL;
                if( $this->unhide ) {
                        $query['unhide'] = 1;
                }
-               $prevlink = $sk->link(
-                       $this->mTitle,
-                       wfMsgHtml( 'previousdiff' ),
-                       array(
-                               'id' => 'differences-prevlink'
-                       ),
-                       $query,
-                       array(
-                               'known',
-                               'noclasses'
-                       )
-               );
+               if( !$this->mOldRev->getPrevious() ) {
+                       $prevlink = '&#160;';
+               } else {
+                       $prevlink = $sk->link(
+                               $this->mTitle,
+                               wfMsgHtml( 'previousdiff' ),
+                               array(
+                                       'id' => 'differences-prevlink'
+                               ),
+                               $query,
+                               array(
+                                       'known',
+                                       'noclasses'
+                               )
+                       );
+               }
 
                # Make "next revision link"
                $query['diff'] = 'next';