r112373 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112372‎ | r112373 | r112374 >
Date:23:37, 24 February 2012
Author:awjrichards
Status:ok
Tags:
Comment:
Revert r112372, should have made the change in trunk rather than in the wmf branch
Modified paths:
  • /branches/wmf/1.19wmf1/includes/api/ApiQueryLogEvents.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/api/ApiQueryLogEvents.php
@@ -198,26 +198,25 @@
199199 * @return array
200200 */
201201 public static function addLogParams( $result, &$vals, $params, $type, $action, $ts ) {
 202+ $params = explode( "\n", $params );
202203 switch ( $type ) {
203204 case 'move':
204 - if ( isset( $params[ '4::target' ] ) ) {
205 - $title = Title::newFromText( $params[ '4::target' ] );
 205+ if ( isset( $params[0] ) ) {
 206+ $title = Title::newFromText( $params[0] );
206207 if ( $title ) {
207208 $vals2 = array();
208209 ApiQueryBase::addTitleInfo( $vals2, $title, 'new_' );
209210 $vals[$type] = $vals2;
210211 }
211212 }
212 - if ( isset( $params[ '5::noredir' ] ) && $params[ '5::noredir' ] ) {
 213+ if ( isset( $params[1] ) && $params[1] ) {
213214 $vals[$type]['suppressedredirect'] = '';
214215 }
215216 $params = null;
216217 break;
217218 case 'patrol':
218219 $vals2 = array();
219 - $vals2[ 'cur' ] = $params[ '4::curid' ];
220 - $vals2[ 'prev' ] = $params[ '5::previd' ];
221 - $vals2[ 'auto' ] = $params[ '6::auto' ];
 220+ list( $vals2['cur'], $vals2['prev'], $vals2['auto'] ) = $params;
222221 $vals[$type] = $vals2;
223222 $params = null;
224223 break;
@@ -251,7 +250,6 @@
252251 }
253252
254253 private function extractRowInfo( $row ) {
255 - $logEntry = DatabaseLogEntry::newFromRow( $row );
256254 $vals = array();
257255
258256 if ( $this->fld_ids ) {
@@ -283,10 +281,10 @@
284282 self::addLogParams(
285283 $this->getResult(),
286284 $vals,
287 - $logEntry->getParameters(),
288 - $logEntry->getType(),
289 - $logEntry->getSubtype(),
290 - $logEntry->getTimestamp()
 285+ $row->log_params,
 286+ $row->log_type,
 287+ $row->log_action,
 288+ $row->log_timestamp
291289 );
292290 }
293291 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112372Attempting to address bug 34653; It seems ApiQueryLogEvents has not kept up w...awjrichards23:36, 24 February 2012

Status & tagging log