From 0e2f6f233dd4f32df5937fad4eabfd024b702efb Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 8 Aug 2011 16:20:17 +0000 Subject: [PATCH] Followup r88488, moved some of the prep work in it that was for r88493 Only apply code if needs to be added (more like SpecialWatchlist) --- includes/api/ApiQueryWatchlist.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 0b7aae6242..f9f67f36af 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -118,7 +118,6 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $this->addTables( array( 'recentchanges', 'watchlist', - 'page', ) ); $userId = $user->getId(); @@ -128,7 +127,6 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { 'wl_namespace=rc_namespace', 'wl_title=rc_title' ) ) ) ); - $this->addJoinConds( array( 'page' => array( 'LEFT JOIN','rc_cur_id=page_id' ) ) ); $this->addWhere( array( 'rc_deleted' => 0, @@ -140,7 +138,12 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $db->timestamp( $params['start'] ), $db->timestamp( $params['end'] ) ); $this->addWhereFld( 'wl_namespace', $params['namespace'] ); - $this->addWhereIf( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG, !$params['allrev'] ); + + if ( !$params['allrev'] ) { + $this->addTables( 'page' ); + $this->addJoinConds( array( 'page' => array( 'LEFT JOIN','rc_cur_id=page_id' ) ) ); + $this->addWhere( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG ); + } if ( !is_null( $params['show'] ) ) { $show = array_flip( $params['show'] ); -- 2.20.1