Skip to content

Commit

Permalink
Update class.GridblockContentSettings.php
Browse files Browse the repository at this point in the history
fix for some notice issues
  • Loading branch information
novinet-dsteffen committed Nov 10, 2021
1 parent c2776cf commit 562d570
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions plugins/contentsettings/lib/class.GridblockContentSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,13 @@ function parseGridblockContentSettings($aArr, $iTemplateId)
// template
if (isset($this->aSettings["showOptions"])) {
foreach ($this->aSettings["showOptions"] as $sKey) {
if ($aArr["template"][$sKey] == "gridblockcontentsettingsdefault") {
$aData["template"][$sKey] = $this->getDefault($sKey);
} else {
$aData["template"][$sKey] = $aArr["template"][$sKey];
if ($this->aSettings["options"][$sKey]["type"] != "html") {
$aData["template"][$sKey] = "";
if ($aArr["template"][$sKey] == "gridblockcontentsettingsdefault") {
$aData["template"][$sKey] = $this->getDefault($sKey);
} else {
$aData["template"][$sKey] = $aArr["template"][$sKey];
}
}
}
}
Expand All @@ -384,14 +387,18 @@ function parseGridblockContentSettings($aArr, $iTemplateId)
$this->getAllSettings("columns");
if (isset($this->aSettings["showOptions"])) {
foreach ($this->aSettings["showOptions"] as $sKey) {
if ($aArr["column_" . $iX][$sKey] == "gridblockcontentsettingsdefault") {
$aArr["column_" . $iX][$sKey] = $this->getDefault($sKey);
} else {
$aData["column_" . $iX][$sKey] = $aArr["column_" . $iX][$sKey];
if ($this->aSettings["options"][$sKey]["type"] != "html") {
$aData["column_" . $iX][$sKey] = "";
if ($aArr["column_" . $iX][$sKey] == "gridblockcontentsettingsdefault") {
$aData["column_" . $iX][$sKey] = $this->getDefault($sKey);
} else {
$aData["column_" . $iX][$sKey] = $aArr["column_" . $iX][$sKey];
}
}
}
}
}

$oData = json_decode(json_encode($aData), FALSE);
return $oData;
}
Expand Down Expand Up @@ -479,7 +486,7 @@ public function getJsonContent($sFile)
if (file_exists($sFile)) {
$sContent = file_get_contents($sFile);
json_decode($sContent);
if (json_last_error() != "JSON_ERROR_NONE") {
if ($sContent && json_last_error() != "JSON_ERROR_NONE") {
if (rex::isBackend()) {
throw new rex_exception("gridblockContentSettings: json Error in File $sFile");
}
Expand Down

0 comments on commit 562d570

Please sign in to comment.