DashletForm: Ensure to dump unselected dashlets before updating the DB

This commit is contained in:
Yonas Habteab 2022-04-14 10:42:27 +02:00
parent 49b37ea522
commit 737f1d459a

View File

@ -152,6 +152,7 @@ class DashletForm extends SetupNewDashboardForm
$this->addHtml($formControls);
}
} else {
// Just setup the initial view of the modal view
parent::assemble();
}
}
@ -212,11 +213,10 @@ class DashletForm extends SetupNewDashboardForm
$currentPane->manageEntry($customDashlet);
}
$this->dumpArbitaryDashlets(false);
// Avoid the hassle of iterating through the module dashlets each time to check if exits,
// even though the current pane doesn't have any entries
if (! $this->getPopulatedValue('new_pane') && $currentPane->hasEntries()) {
$this->dumpArbitaryDashlets(false);
foreach (self::$moduleDashlets as $_ => $dashlets) {
/** @var Dashlet $dashlet */
foreach ($dashlets as $dashlet) {