Undefined offset in ApiQueryLogEvents
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 17 Nov 2012 21:02:07 +0000 (22:02 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 17 Nov 2012 21:02:07 +0000 (22:02 +0100)
Follow up Ie188bc6f: Necessary changes to api for rights log changes

Getting for new style logs:
Notice: Undefined offset: 1 in \includes\api\ApiQueryLogEvents.php on
line 245
Notice: Undefined offset: 0 in \includes\api\ApiQueryLogEvents.php on
line 245

Added a legacy part as seen by patrol and move for the rights log action

Change-Id: I1d0bdfb483dba30572e8dcf8faac331a77eb04c6

includes/api/ApiQueryLogEvents.php

index 5d85c22..e51b558 100644 (file)
@@ -241,7 +241,12 @@ class ApiQueryLogEvents extends ApiQueryBase {
                                break;
                        case 'rights':
                                $vals2 = array();
-                               list( $vals2['old'], $vals2['new'] ) = $params;
+                               if( $legacy ) {
+                                       list( $vals2['old'], $vals2['new'] ) = $params;
+                               } else {
+                                       $vals2['new'] = implode( ', ', $params['5::newgroups'] );
+                                       $vals2['old'] = implode( ', ', $params['4::oldgroups'] );
+                               }
                                $vals[$type] = $vals2;
                                $params = null;
                                break;