From 2d829d82005caa865ed34570ef03ca53c38f15ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Viguier?= Date: Thu, 31 Aug 2023 13:05:24 +0200 Subject: [PATCH] formatFieldMultiselectForFront : doesn't check against choices list for front: good for performances --- classes/prettyblocks/core/PrettyBlocksField.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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']; + } } /**