diff --git a/Entity/FormSubmissionFieldTypes/ChoiceFormSubmissionField.php b/Entity/FormSubmissionFieldTypes/ChoiceFormSubmissionField.php index 2b30cf5..09b553b 100644 --- a/Entity/FormSubmissionFieldTypes/ChoiceFormSubmissionField.php +++ b/Entity/FormSubmissionFieldTypes/ChoiceFormSubmissionField.php @@ -77,12 +77,12 @@ public function __toString() if (is_array($values) && sizeof($values) > 0) { $result = array(); foreach ($values as $value) { - $result[] = array_key_exists($value, $choices) ? $choices[$value] : $value; + $result[] = array_key_exists($value, $choices) ? trim($choices[$value]) : $value; } return implode(", ", $result); } else { if (isset($choices[$values])) { - return $choices[$values]; + return trim($choices[$values]); } } } diff --git a/Entity/PageParts/ChoicePagePart.php b/Entity/PageParts/ChoicePagePart.php index 16d3f17..65de238 100755 --- a/Entity/PageParts/ChoicePagePart.php +++ b/Entity/PageParts/ChoicePagePart.php @@ -89,6 +89,7 @@ public function getDefaultView() public function adaptForm(FormBuilderInterface $formBuilder, ArrayObject $fields) { $choices = explode("\n", $this->getChoices()); + $choices = array_map('trim', $choices); $cfsf = new ChoiceFormSubmissionField(); $cfsf->setFieldName("field_" . $this->getUniqueId());