diff --git a/application/forms/Dashboard/HomeForm.php b/application/forms/Dashboard/HomeForm.php index aebd1be42..3d65403b2 100644 --- a/application/forms/Dashboard/HomeForm.php +++ b/application/forms/Dashboard/HomeForm.php @@ -41,6 +41,10 @@ class HomeForm extends BaseDashboardForm { if ($this->isUpdating()) { $home = $this->dashboard->getActiveHome(); + if ($home->getTitle() === $this->getPopulatedValue('title')) { + return; + } + $home->setTitle($this->getPopulatedValue('title')); $this->dashboard->manageEntry($home); diff --git a/application/forms/Dashboard/PaneForm.php b/application/forms/Dashboard/PaneForm.php index c5fb0fe04..297657f87 100644 --- a/application/forms/Dashboard/PaneForm.php +++ b/application/forms/Dashboard/PaneForm.php @@ -88,12 +88,18 @@ class PaneForm extends BaseDashboardForm if ($this->isUpdating()) { $orgHome = $dashboard->getEntry($this->requestUrl->getParam('home')); + $orgPane = $orgHome->getEntry($this->getValue('org_name')); - $currentPane = clone $orgHome->getEntry($this->getValue('org_name')); + $currentPane = clone $orgPane; $currentPane ->setHome($currentHome) ->setTitle($this->getValue('title')); + $diff = array_filter(array_diff_assoc($currentPane->toArray(), $orgPane->toArray())); + if (empty($diff)) { + return; + } + if ($orgHome->getName() !== $currentHome->getName() && $currentHome->hasEntry($currentPane->getName())) { Notification::error(sprintf( t('Failed to move dashboard "%s": Dashbaord pane already exists within the "%s" dashboard home'), @@ -104,12 +110,6 @@ class PaneForm extends BaseDashboardForm return; } - if ($currentHome->getName() === $orgHome->getName()) { - // There is no dashboard home diff so clear all the dashboard pane - // of the org home - $orgHome->setEntries([]); - } - $conn->beginTransaction(); try {