diff --git a/classes/PrettyBlocksModel.php b/classes/PrettyBlocksModel.php index c4b765b3..9e025717 100644 --- a/classes/PrettyBlocksModel.php +++ b/classes/PrettyBlocksModel.php @@ -660,11 +660,9 @@ public static function getBlocksAvailable() $data[0] = $data; } foreach ($data as $block) { - if (!empty($block['code'])) { - $blocks[$block['code']] = $block; - // formatted for LeftPanel.vue - $blocks[$block['code']]['formatted'] = self::formatBlock($block); - } + $blocks[$block['code']] = $block; + // formatted for LeftPanel.vue + $blocks[$block['code']]['formatted'] = self::formatBlock($block); } } @@ -686,7 +684,7 @@ private static function formatBlock($block) $formatted['icon'] = $block['icon'] ?? 'PhotographIcon'; $formatted['icon_path'] = $block['icon_path'] ?? ''; $formatted['module'] = $block['code']; // todo register module name - $formatted['title'] = $block['name'] ?? ''; + $formatted['title'] = $block['name']; // dump($block); // if nameFrom params is present diff --git a/classes/prettyblocks/core/PrettyBlocksField.php b/classes/prettyblocks/core/PrettyBlocksField.php index cca2bbc1..dfc1d2a3 100644 --- a/classes/prettyblocks/core/PrettyBlocksField.php +++ b/classes/prettyblocks/core/PrettyBlocksField.php @@ -699,7 +699,13 @@ private function formatFieldSelect() */ private function formatFieldMultiselectForFront() { - return $this->formatFieldMultiselect(); + if (is_array($this->value)) { + return $this->value; + } + // if value doesn't exists in DB and new value is not set return default value + if ($this->force_default_value && isset($this->field['default'])) { + return $this->field['default']; + } } /**