diff --git a/application/controllers/DashboardsController.php b/application/controllers/DashboardsController.php index 93115d9a8..eec5f6b0a 100644 --- a/application/controllers/DashboardsController.php +++ b/application/controllers/DashboardsController.php @@ -249,6 +249,11 @@ class DashboardsController extends CompatController $this->dashboard->load(); + $home = $this->params->getRequired('home'); + // TODO: Shouldn't be necessary. load() should get the name already and + // the form should otherwise ensure it has the required data + $this->dashboard->activateHome($this->dashboard->getEntry($home)); + $dashletForm = new DashletForm($this->dashboard); $dashletForm->populate($this->getRequest()->getPost()); $dashletForm->on(DashletForm::ON_SUCCESS, function () { diff --git a/application/forms/Dashboard/DashletForm.php b/application/forms/Dashboard/DashletForm.php index c21e0f80d..68e07225a 100644 --- a/application/forms/Dashboard/DashletForm.php +++ b/application/forms/Dashboard/DashletForm.php @@ -56,7 +56,7 @@ class DashletForm extends SetupNewDashboardForm $panes = $firstHome->getEntryKeyTitleArr(); } } else { - $panes = $activeHome->getEntryKeyTitleArr(); + $panes = $activeHome->loadDashboardEntries()->getEntryKeyTitleArr(); } } elseif ($this->dashboard->hasEntry($populatedHome)) { $this->dashboard->loadDashboardEntries($populatedHome);