From: Tim Starling Date: Sun, 11 Jun 2006 04:48:27 +0000 (+0000) Subject: Don't do 100 queries to view 50 revisions in history pages. X-Git-Tag: 1.31.0-rc.0~56810 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=e62aea13c65e13acd277c2e7586fb050a946e0f7;p=lhc%2Fweb%2Fwiklou.git Don't do 100 queries to view 50 revisions in history pages. --- diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 4cd9a3f7ba..7afd629ee0 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -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 = '
  • '; $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(), diff --git a/includes/Revision.php b/includes/Revision.php index b2f8e1890b..7ee0ffa5e2 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -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 */