Fix very old log params of log type rights for new api logparam style
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 18 Apr 2015 09:25:54 +0000 (11:25 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 18 Apr 2015 09:25:54 +0000 (11:25 +0200)
After I9109a27f416b002e5c562a1454d8c373dcf98fb4 list=logevents also
called the log formatter for empty params, which than result in a
undefined index warning, because log entry without log params can exists
for the rights log type.

Follow-Up: I4762743b3f43e6ebd806d3ae516507ae66478e96
Change-Id: I169a00f0e39fe88d23111b62f18a9f5cf60866dc

includes/logging/RightsLogFormatter.php

index f69530c..352bda5 100644 (file)
@@ -116,8 +116,13 @@ class RightsLogFormatter extends LogFormatter {
                        }
                }
 
-               $params['4:array:oldgroups'] = $this->makeGroupArray( $params['4:array:oldgroups'] );
-               $params['5:array:newgroups'] = $this->makeGroupArray( $params['5:array:newgroups'] );
+               // Really old entries does not have log params
+               if ( isset( $params['4:array:oldgroups'] ) ) {
+                       $params['4:array:oldgroups'] = $this->makeGroupArray( $params['4:array:oldgroups'] );
+               }
+               if ( isset( $params['5:array:newgroups'] ) ) {
+                       $params['5:array:newgroups'] = $this->makeGroupArray( $params['5:array:newgroups'] );
+               }
 
                return $params;
        }