Don't do 100 queries to view 50 revisions in history pages.
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 11 Jun 2006 04:48:27 +0000 (04:48 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 11 Jun 2006 04:48:27 +0000 (04:48 +0000)
includes/PageHistory.php
includes/Revision.php

index 4cd9a3f..7afd629 100644 (file)
@@ -229,6 +229,7 @@ class PageHistory {
        function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) {
                global $wgUser;
                $rev = new Revision( $row );
+               $rev->setTitle( $this->mTitle );
 
                $s = '<li>';
                $curlink = $this->curLink( $rev, $latest );
@@ -493,6 +494,11 @@ class PageHistory {
                                'wl_user' => $wgUser->getID()
                        ),
                        $fname);
+               
+               // Don't use the special value reserved for telling whether the field is filled
+               if ( is_null( $this->mNotificationTimestamp ) ) {
+                       $this->mNotificationTimestamp = false;
+               }
 
                return $this->mNotificationTimestamp;
        }
@@ -624,6 +630,7 @@ class PageHistory {
         */
        function feedItem( $row ) {
                $rev = new Revision( $row );
+               $rev->setTitle( $this->mTitle );
                $text = rcFormatDiffRow( $this->mTitle,
                        $this->mTitle->getPreviousRevisionID( $rev->getId() ),
                        $rev->getId(),
index b2f8e18..7ee0ffa 100644 (file)
@@ -320,7 +320,7 @@ class Revision {
                        array( 'page_namespace', 'page_title' ),
                        array( 'page_id=rev_page',
                               'rev_id' => $this->mId ),
-                       'Revision::getTItle' );
+                       'Revision::getTitle' );
                if( $row ) {
                        $this->mTitle = Title::makeTitle( $row->page_namespace,
                                                           $row->page_title );
@@ -328,6 +328,14 @@ class Revision {
                return $this->mTitle;
        }
 
+       /**
+        * Set the title of the revision
+        * @param Title $title
+        */
+       function setTitle( $title ) {
+               $this->mTitle = $title;
+       }
+
        /**
         * @return int
         */