r112701 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112700‎ | r112701 | r112702 >
Date:17:52, 29 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1 (modified) (history)
  • /branches/wmf/1.19wmf1/includes (modified) (history)
  • /branches/wmf/1.19wmf1/includes/api (modified) (history)
  • /branches/wmf/1.19wmf1/includes/api/ApiQueryLogEvents.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/api/ApiQueryLogEvents.php
@@ -197,27 +197,44 @@
198198 * @param $ts
199199 * @return array
200200 */
201 - public static function addLogParams( $result, &$vals, $params, $type, $action, $ts ) {
 201+ public static function addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy = false ) {
202202 switch ( $type ) {
203203 case 'move':
204 - if ( isset( $params[ '4::target' ] ) ) {
205 - $title = Title::newFromText( $params[ '4::target' ] );
 204+ if ( $legacy ){
 205+ $targetKey = 0;
 206+ $noredirKey = 1;
 207+ } else {
 208+ $targetKey = '4::target';
 209+ $noredirKey = '5::noredir';
 210+ }
 211+
 212+ if ( isset( $params[ $targetKey ] ) ) {
 213+ $title = Title::newFromText( $params[ $targetKey ] );
206214 if ( $title ) {
207215 $vals2 = array();
208216 ApiQueryBase::addTitleInfo( $vals2, $title, 'new_' );
209217 $vals[$type] = $vals2;
210218 }
211219 }
212 - if ( isset( $params[ '5::noredir' ] ) && $params[ '5::noredir' ] ) {
 220+ if ( isset( $params[ $noredirKey ] ) && $params[ $noredirKey ] ) {
213221 $vals[$type]['suppressedredirect'] = '';
214222 }
215223 $params = null;
216224 break;
217225 case 'patrol':
 226+ if ( $legacy ){
 227+ $cur = 0;
 228+ $prev = 1;
 229+ $auto = 2;
 230+ } else {
 231+ $cur = '4::curid';
 232+ $prev = '5::previd';
 233+ $auto = '6::auto';
 234+ }
218235 $vals2 = array();
219 - $vals2[ 'cur' ] = $params[ '4::curid' ];
220 - $vals2[ 'prev' ] = $params[ '5::previd' ];
221 - $vals2[ 'auto' ] = $params[ '6::auto' ];
 236+ $vals2['cur'] = $params[$cur];
 237+ $vals2['prev'] = $params[$prev];
 238+ $vals2['auto'] = $params[$auto];
222239 $vals[$type] = $vals2;
223240 $params = null;
224241 break;
@@ -286,7 +303,8 @@
287304 $logEntry->getParameters(),
288305 $logEntry->getType(),
289306 $logEntry->getSubtype(),
290 - $logEntry->getTimestamp()
 307+ $logEntry->getTimestamp(),
 308+ $logEntry->isLegacy()
291309 );
292310 }
293311 }
Property changes on: branches/wmf/1.19wmf1/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
294312 Merged /trunk/phase3/includes/api:r112700
Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
295313 Merged /trunk/phase3/includes:r112700
Property changes on: branches/wmf/1.19wmf1
___________________________________________________________________
Modified: svn:mergeinfo
296314 Merged /trunk/phase3:r112700

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112700Followup r112374/bug 34653...reedy17:50, 29 February 2012

Status & tagging log