From: umherirrender Date: Sat, 18 Apr 2015 09:25:54 +0000 (+0200) Subject: Fix very old log params of log type rights for new api logparam style X-Git-Tag: 1.31.0-rc.0~11652^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22upgrade%22%2C%22reinstall=non%22%29%20.%20%22?a=commitdiff_plain;h=fbc870b2497352b1fc498905865475803ad311ca;p=lhc%2Fweb%2Fwiklou.git Fix very old log params of log type rights for new api logparam style 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 --- diff --git a/includes/logging/RightsLogFormatter.php b/includes/logging/RightsLogFormatter.php index f69530ccd7..352bda58ca 100644 --- a/includes/logging/RightsLogFormatter.php +++ b/includes/logging/RightsLogFormatter.php @@ -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; }