r94062 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94061‎ | r94062 | r94063 >
Date:16:20, 8 August 2011
Author:reedy
Status:ok
Tags:
Comment:
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)
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -118,7 +118,6 @@
119119 $this->addTables( array(
120120 'recentchanges',
121121 'watchlist',
122 - 'page',
123122 ) );
124123
125124 $userId = $user->getId();
@@ -128,7 +127,6 @@
129128 'wl_namespace=rc_namespace',
130129 'wl_title=rc_title'
131130 ) ) ) );
132 - $this->addJoinConds( array( 'page' => array( 'LEFT JOIN','rc_cur_id=page_id' ) ) );
133131
134132 $this->addWhere( array(
135133 'rc_deleted' => 0,
@@ -140,8 +138,13 @@
141139 $db->timestamp( $params['start'] ),
142140 $db->timestamp( $params['end'] ) );
143141 $this->addWhereFld( 'wl_namespace', $params['namespace'] );
144 - $this->addWhereIf( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG, !$params['allrev'] );
145142
 143+ if ( !$params['allrev'] ) {
 144+ $this->addTables( 'page' );
 145+ $this->addJoinConds( array( 'page' => array( 'LEFT JOIN','rc_cur_id=page_id' ) ) );
 146+ $this->addWhere( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG );
 147+ }
 148+
146149 if ( !is_null( $params['show'] ) ) {
147150 $show = array_flip( $params['show'] );
148151

Follow-up revisions

RevisionCommit summaryAuthorDate
r96088MFT to REL1_18...hashar10:53, 2 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88488Similarise queries to that of SpecialWatchlistreedy21:30, 20 May 2011
r88493* (bug 20699) API watchlist should list log-events...reedy21:47, 20 May 2011

Status & tagging log