Fix issues with AJAX handlers on dashboard widgets. Replaces #4132

This commit is contained in:
Luke Towers 2019-02-13 15:05:18 -06:00
parent a97a17c4c3
commit bbf398133e
2 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,14 @@ class ReportWidgetBase extends WidgetBase
{
$this->properties = $this->validateProperties($properties);
/*
* Ensure the provided alias (if present) takes effect as the widget configuration is
* not passed to the WidgetBase constructor which would normally take care of that
*/
if (!isset($this->alias)) {
$this->alias = $properties['alias'] ?? $this->defaultAlias;
}
parent::__construct($controller);
}
}

View File

@ -236,6 +236,9 @@ class ReportContainer extends WidgetBase
}
while (array_key_exists($alias, $widgets));
// Ensure that the widget's alias is correctly set for this request
$widget->alias = $alias;
$sortOrder = 0;
foreach ($widgets as $widgetInfo) {
$sortOrder = max($sortOrder, $widgetInfo['sortOrder']);