r88494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88493‎ | r88494 | r88495 >
Date:22:01, 20 May 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 29063) When viewing list=recentchanges&rcprop=loginfo for an unblock entry, get undefined index

Unblocks have no params, so skip adding info
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -437,8 +437,11 @@
438438 $vals['logaction'] = $row->rc_log_action;
439439 ApiQueryLogEvents::addLogParams(
440440 $this->getResult(),
441 - $vals, $row->rc_params,
442 - $row->rc_log_type, $row->rc_timestamp
 441+ $vals,
 442+ $row->rc_params,
 443+ $row->rc_log_action,
 444+ $row->rc_log_type,
 445+ $row->rc_timestamp
443446 );
444447 }
445448
Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -198,13 +198,14 @@
199199
200200 /**
201201 * @param $result ApiResult
202 - * @param $vals
203 - * @param $params
204 - * @param $type
 202+ * @param $vals array
 203+ * @param $params string
 204+ * @param $type string
 205+ * @param $action string
205206 * @param $ts
206207 * @return array
207208 */
208 - public static function addLogParams( $result, &$vals, $params, $type, $ts ) {
 209+ public static function addLogParams( $result, &$vals, $params, $type, $action, $ts ) {
209210 $params = explode( "\n", $params );
210211 switch ( $type ) {
211212 case 'move':
@@ -234,6 +235,9 @@
235236 $params = null;
236237 break;
237238 case 'block':
 239+ if ( $action == 'unblock' ) {
 240+ break;
 241+ }
238242 $vals2 = array();
239243 list( $vals2['duration'], $vals2['flags'] ) = $params;
240244
@@ -283,8 +287,11 @@
284288 $vals['actionhidden'] = '';
285289 } else {
286290 self::addLogParams(
287 - $this->getResult(), $vals,
288 - $row->log_params, $row->log_type,
 291+ $this->getResult(),
 292+ $vals,
 293+ $row->log_params,
 294+ $row->log_type,
 295+ $row->log_action,
289296 $row->log_timestamp
290297 );
291298 }
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -306,8 +306,11 @@
307307 $vals['logaction'] = $row->rc_log_action;
308308 ApiQueryLogEvents::addLogParams(
309309 $this->getResult(),
310 - $vals, $row->rc_params,
311 - $row->rc_log_type, $row->rc_timestamp
 310+ $vals,
 311+ $row->rc_params,
 312+ $row->rc_log_type,
 313+ $row->rc_log_action,
 314+ $row->rc_timestamp
312315 );
313316 }
314317

Status & tagging log