r112372 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112371‎ | r112372 | r112373 >
Date:23:36, 24 February 2012
Author:awjrichards
Status:reverted
Tags:
Comment:
Attempting to address bug 34653; It seems ApiQueryLogEvents has not kept up with changes to the Logging classes. I've changed some aspects of the ApiQueryLogEvents to use a DatabaseLogEntry object when extracting log row information and updated addLogParams to use this new scheme for handling parameters. I have not been able to sufficiently test this and I am still concerned about backwards compatibility with old parameter formats for older log records as well as parameter handling for the 'rights' and 'block' log types.
Modified paths:
  • /branches/wmf/1.19wmf1/includes/api/ApiQueryLogEvents.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/api/ApiQueryLogEvents.php
@@ -198,25 +198,26 @@
199199 * @return array
200200 */
201201 public static function addLogParams( $result, &$vals, $params, $type, $action, $ts ) {
202 - $params = explode( "\n", $params );
203202 switch ( $type ) {
204203 case 'move':
205 - if ( isset( $params[0] ) ) {
206 - $title = Title::newFromText( $params[0] );
 204+ if ( isset( $params[ '4::target' ] ) ) {
 205+ $title = Title::newFromText( $params[ '4::target' ] );
207206 if ( $title ) {
208207 $vals2 = array();
209208 ApiQueryBase::addTitleInfo( $vals2, $title, 'new_' );
210209 $vals[$type] = $vals2;
211210 }
212211 }
213 - if ( isset( $params[1] ) && $params[1] ) {
 212+ if ( isset( $params[ '5::noredir' ] ) && $params[ '5::noredir' ] ) {
214213 $vals[$type]['suppressedredirect'] = '';
215214 }
216215 $params = null;
217216 break;
218217 case 'patrol':
219218 $vals2 = array();
220 - list( $vals2['cur'], $vals2['prev'], $vals2['auto'] ) = $params;
 219+ $vals2[ 'cur' ] = $params[ '4::curid' ];
 220+ $vals2[ 'prev' ] = $params[ '5::previd' ];
 221+ $vals2[ 'auto' ] = $params[ '6::auto' ];
221222 $vals[$type] = $vals2;
222223 $params = null;
223224 break;
@@ -250,6 +251,7 @@
251252 }
252253
253254 private function extractRowInfo( $row ) {
 255+ $logEntry = DatabaseLogEntry::newFromRow( $row );
254256 $vals = array();
255257
256258 if ( $this->fld_ids ) {
@@ -281,10 +283,10 @@
282284 self::addLogParams(
283285 $this->getResult(),
284286 $vals,
285 - $row->log_params,
286 - $row->log_type,
287 - $row->log_action,
288 - $row->log_timestamp
 287+ $logEntry->getParameters(),
 288+ $logEntry->getType(),
 289+ $logEntry->getSubtype(),
 290+ $logEntry->getTimestamp()
289291 );
290292 }
291293 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r112373Revert r112372, should have made the change in trunk rather than in the wmf b...awjrichards23:37, 24 February 2012
r112374Attempting to address bug 34653; It seems ApiQueryLogEvents has not kept up w...awjrichards23:39, 24 February 2012
r112700Followup r112374/bug 34653...reedy17:50, 29 February 2012

Status & tagging log