From fdc9b36ee5397717e67d0cebfa3facccd9281b9d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 22 Apr 2022 08:57:59 +0200 Subject: [PATCH] Follow-up for 63802dfc4 --- application/controllers/DashboardsController.php | 5 +++++ application/forms/Dashboard/DashletForm.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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);