Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -118,7 +118,6 @@ |
119 | 119 | $this->addTables( array( |
120 | 120 | 'recentchanges', |
121 | 121 | 'watchlist', |
122 | | - 'page', |
123 | 122 | ) ); |
124 | 123 | |
125 | 124 | $userId = $user->getId(); |
— | — | @@ -128,7 +127,6 @@ |
129 | 128 | 'wl_namespace=rc_namespace', |
130 | 129 | 'wl_title=rc_title' |
131 | 130 | ) ) ) ); |
132 | | - $this->addJoinConds( array( 'page' => array( 'LEFT JOIN','rc_cur_id=page_id' ) ) ); |
133 | 131 | |
134 | 132 | $this->addWhere( array( |
135 | 133 | 'rc_deleted' => 0, |
— | — | @@ -140,8 +138,13 @@ |
141 | 139 | $db->timestamp( $params['start'] ), |
142 | 140 | $db->timestamp( $params['end'] ) ); |
143 | 141 | $this->addWhereFld( 'wl_namespace', $params['namespace'] ); |
144 | | - $this->addWhereIf( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG, !$params['allrev'] ); |
145 | 142 | |
| 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 | + |
146 | 149 | if ( !is_null( $params['show'] ) ) { |
147 | 150 | $show = array_flip( $params['show'] ); |
148 | 151 | |