Skip to content

Commit 3d91b78

Browse files
committed
Fixes a bug in report container not loading defaults and ignoring context
1 parent 88232c8 commit 3d91b78

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

modules/backend/widgets/ReportContainer.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,23 @@ class ReportContainer extends WidgetBase
7373
/**
7474
* Constructor.
7575
*/
76-
public function __construct($controller)
76+
public function __construct($controller, $configuration = null)
7777
{
78-
$configFile = 'config_' . snake_case($this->alias) . '.yaml';
79-
$path = $controller->getConfigPath($configFile);
80-
if (File::isFile($path)) {
81-
$config = $this->makeConfig($configFile);
78+
if (!$configuration) {
79+
$configuration = 'config_report_container.yaml';
8280
}
83-
else {
84-
$config = [];
81+
82+
if (!is_array($configuration)) {
83+
$path = $controller->getConfigPath($configuration);
84+
if (File::isFile($path)) {
85+
$configuration = $this->makeConfig($path);
86+
}
87+
else {
88+
$configuration = [];
89+
}
8590
}
8691

87-
parent::__construct($controller, $config);
92+
parent::__construct($controller, $configuration);
8893

8994
$this->bindToController();
9095
$this->fillFromConfig();

0 commit comments

Comments
 (0)