Skip to content

Commit

Permalink
Fix error undefined index 'analytics' - related to #12911 (#13594)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvesh3 committed Nov 18, 2022
1 parent c97929a commit b92e50e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
9 changes: 1 addition & 8 deletions lib/Analytics/Google/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ public function __construct(array $config)

public static function fromReportConfig(array $reportConfig): self
{
$config = null;
if ($reportConfig['analytics']) {
$config = $reportConfig['analytics'];
} else {
$config = [];
}

return new self($config);
return new self($reportConfig['analytics'] ?? []);
}

public function getConfig(): array
Expand Down
7 changes: 1 addition & 6 deletions lib/Analytics/Google/Config/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ protected function loadDefaultConfigObject(): array
{
$reportConfig = \Pimcore\Config::getReportConfig();

$config = $reportConfig['analytics'];
if (!is_array($config)) {
$config = [];
}

return $config;
return $reportConfig['analytics'] ?? [];
}
}

0 comments on commit b92e50e

Please sign in to comment.