From: Aaron Schulz Date: Thu, 19 Apr 2018 04:38:47 +0000 (-0700) Subject: Avoid warnings in ObjectCache::newWANCacheFromParams if "channels" is not set" X-Git-Tag: 1.34.0-rc.0~5678^2 X-Git-Url: http://git.cyclocoop.org/wiki/Speciaal:Userlogin?a=commitdiff_plain;h=8350329922370a107aa069e8d5b52918801b661a;p=lhc%2Fweb%2Fwiklou.git Avoid warnings in ObjectCache::newWANCacheFromParams if "channels" is not set" Bug: T192473 Change-Id: I150eef62285e99fc1269a58fee3827e5fbb0537b --- diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 67d2346013..a6f55e6026 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -337,9 +337,11 @@ class ObjectCache { $services = MediaWikiServices::getInstance(); $erGroup = $services->getEventRelayerGroup(); - foreach ( $params['channels'] as $action => $channel ) { - $params['relayers'][$action] = $erGroup->getRelayer( $channel ); - $params['channels'][$action] = $channel; + if ( isset( $params['channels'] ) ) { + foreach ( $params['channels'] as $action => $channel ) { + $params['relayers'][$action] = $erGroup->getRelayer( $channel ); + $params['channels'][$action] = $channel; + } } $params['cache'] = self::newFromParams( $params['store'] ); if ( isset( $params['loggroup'] ) ) {