diff --git a/application/dashboard.class.inc.php b/application/dashboard.class.inc.php index 98c8c9e1f..737720e86 100644 --- a/application/dashboard.class.inc.php +++ b/application/dashboard.class.inc.php @@ -176,12 +176,6 @@ abstract class Dashboard protected function InitDashletFromDOMNode($oDomNode) { $sId = $oDomNode->getAttribute('id'); - // To avoid collision with other dashlets with the same ID we suffix it. Collisions typically happen with extensions. - // Note: The check is done so we don't append it at each save of the dashboard. - if(strpos($sId, 'uniqid_') === false) - { - $sId .= '_uniqid_' . uniqid(); - } $sDashletType = $oDomNode->getAttribute('xsi:type'); diff --git a/application/dashboardlayout.class.inc.php b/application/dashboardlayout.class.inc.php index f1f2002e2..8ed7be5ec 100644 --- a/application/dashboardlayout.class.inc.php +++ b/application/dashboardlayout.class.inc.php @@ -26,14 +26,9 @@ abstract class DashboardLayout { - public function __construct() - { - - } - abstract public function Render($oPage, $aDashlets, $bEditMode = false); - static public function GetInfo() + public static function GetInfo() { return array( 'label' => '', @@ -61,7 +56,7 @@ abstract class DashboardLayoutMultiCol extends DashboardLayout { /** @var \Dashlet $oDashlet */ $oDashlet = $aDashlets[$aKeys[$idx]]; - if ($oDashlet->IsVisible()) + if ($oDashlet::IsVisible()) { $bNoVisibleFound = false; } @@ -134,6 +129,10 @@ abstract class DashboardLayoutMultiCol extends DashboardLayout { if ($oDashlet->IsVisible()) { + $sDashboardId = $oDashlet->GetID(); + // N°2634 : we must have a unique id per dashlet ! + // To avoid collision with other dashlets with the same ID we prefix it. Collisions typically happen with extensions. + $oDashlet->SetID("row$iRows-col$iCols-$sDashboardId"); $oDashlet->DoRender($oPage, $bEditMode, true /* bEnclosingDiv */, $aExtraParams); } }