Skip to content

Commit

Permalink
Merge pull request #71 from Kunstmaan/feature/fix_export_newline
Browse files Browse the repository at this point in the history
trim new line
  • Loading branch information
jverdeyen committed Jul 18, 2014
2 parents 4ce4908 + beb3260 commit 2416410
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Entity/FormSubmissionFieldTypes/ChoiceFormSubmissionField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Entity/PageParts/ChoicePagePart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 2416410

Please sign in to comment.