Skip to content

Commit

Permalink
N°6617 Fix issue when providing invalid dashboard layout class (#689)
Browse files Browse the repository at this point in the history
N°6617 Fix issue when providing invalid dashboard layout class
  • Loading branch information
Timmy38 authored Dec 9, 2024
1 parent 3b19769 commit eedbf3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions application/dashboard.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,21 +296,21 @@ public function ToDOMNode($oDefinition)
public function FromParams($aParams)
{
$this->sLayoutClass = $aParams['layout_class'];
if (!is_subclass_of($this->sLayoutClass,DashboardLayout::class)) {
throw new InvalidParameterException('Invalid parameter layout_class "'.$aParams['layout_class'].'"');
}
$this->sTitle = $aParams['title'];
$this->bAutoReload = $aParams['auto_reload'] == 'true';
$this->iAutoReloadSec = max(MetaModel::GetConfig()->Get('min_reload_interval'), (int) $aParams['auto_reload_sec']);

foreach($aParams['cells'] as $aCell)
{
foreach($aParams['cells'] as $aCell) {
$aCellDashlets = array();
foreach($aCell as $aDashletParams)
{
foreach($aCell as $aDashletParams) {
$sDashletClass = $aDashletParams['dashlet_class'];
$sId = $aDashletParams['dashlet_id'];
/** @var \Dashlet $oNewDashlet */
$oNewDashlet = new $sDashletClass($this->oMetaModel, $sId);
if (isset($aDashletParams['dashlet_type']))
{
if (isset($aDashletParams['dashlet_type'])) {
$oNewDashlet->SetDashletType($aDashletParams['dashlet_type']);
}
$oForm = $oNewDashlet->GetForm();
Expand Down

0 comments on commit eedbf3d

Please sign in to comment.