From e62aea13c65e13acd277c2e7586fb050a946e0f7 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 11 Jun 2006 04:48:27 +0000 Subject: [PATCH] Don't do 100 queries to view 50 revisions in history pages. --- includes/PageHistory.php | 7 +++++++ includes/Revision.php | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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 */ -- 2.20.1