diff --git a/classes/PrettyBlocksModel.php b/classes/PrettyBlocksModel.php index d81c7ff..0557b72 100644 --- a/classes/PrettyBlocksModel.php +++ b/classes/PrettyBlocksModel.php @@ -391,7 +391,7 @@ public function updateConfig($stateRequest) $fields = []; $stateRequest = json_decode($stateRequest, true); $fieldsRequest = array_filter($stateRequest, function ($field) { - return isset($field['type']); + return isset($field['type']) && $field['type'] !== 'title'; }); foreach ($fieldsRequest as $key => $field) { @@ -399,7 +399,10 @@ public function updateConfig($stateRequest) $fields[$key] = $obj; } $this->setConfigFields($fields); - $this->config = $this->generateJsonConfig(); + $existingConfig = json_decode($this->config, true); + $newConfig = json_decode($this->generateJsonConfig(), true); + $mergedConfig = array_merge($existingConfig, $newConfig); + $this->config = json_encode($mergedConfig); $template_name = pSQL($stateRequest['templateSelected']); $this->setCurrentTemplate($template_name); $this->setDefaultParams($stateRequest['default']);