Index: branches/wmf/1.19wmf1/includes/api/ApiQueryLogEvents.php |
— | — | @@ -197,27 +197,44 @@ |
198 | 198 | * @param $ts |
199 | 199 | * @return array |
200 | 200 | */ |
201 | | - public static function addLogParams( $result, &$vals, $params, $type, $action, $ts ) { |
| 201 | + public static function addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy = false ) { |
202 | 202 | switch ( $type ) { |
203 | 203 | 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 ] ); |
206 | 214 | if ( $title ) { |
207 | 215 | $vals2 = array(); |
208 | 216 | ApiQueryBase::addTitleInfo( $vals2, $title, 'new_' ); |
209 | 217 | $vals[$type] = $vals2; |
210 | 218 | } |
211 | 219 | } |
212 | | - if ( isset( $params[ '5::noredir' ] ) && $params[ '5::noredir' ] ) { |
| 220 | + if ( isset( $params[ $noredirKey ] ) && $params[ $noredirKey ] ) { |
213 | 221 | $vals[$type]['suppressedredirect'] = ''; |
214 | 222 | } |
215 | 223 | $params = null; |
216 | 224 | break; |
217 | 225 | 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 | + } |
218 | 235 | $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]; |
222 | 239 | $vals[$type] = $vals2; |
223 | 240 | $params = null; |
224 | 241 | break; |
— | — | @@ -286,7 +303,8 @@ |
287 | 304 | $logEntry->getParameters(), |
288 | 305 | $logEntry->getType(), |
289 | 306 | $logEntry->getSubtype(), |
290 | | - $logEntry->getTimestamp() |
| 307 | + $logEntry->getTimestamp(), |
| 308 | + $logEntry->isLegacy() |
291 | 309 | ); |
292 | 310 | } |
293 | 311 | } |
Property changes on: branches/wmf/1.19wmf1/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
294 | 312 | Merged /trunk/phase3/includes/api:r112700 |
Property changes on: branches/wmf/1.19wmf1/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
295 | 313 | Merged /trunk/phase3/includes:r112700 |
Property changes on: branches/wmf/1.19wmf1 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
296 | 314 | Merged /trunk/phase3:r112700 |