[BUGFIX] Do not ignore empty value in OptionViewHelper 22/54122/2
authorRaphael Graf <graf@netvertising.ch>
Mon, 11 Sep 2017 18:55:51 +0000 (20:55 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Tue, 26 Sep 2017 14:51:25 +0000 (16:51 +0200)
Resolves: #82457
Releases: master
Change-Id: I42a1fdb85e87db4601ceefdd52e0dd4f1722bd23
Reviewed-on: https://review.typo3.org/54122
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: David Hoeckele <hoeckele@netvertising.ch>
Reviewed-by: Markus Sommer <markus.sommer@typo3.org>
Tested-by: Markus Sommer <markus.sommer@typo3.org>
Reviewed-by: Sascha Rademacher <s.rademacher@neusta.de>
Tested-by: Sascha Rademacher <s.rademacher@neusta.de>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/fluid/Classes/ViewHelpers/Form/Select/OptionViewHelper.php

index 981fd32..a7a389a 100644 (file)
@@ -55,9 +55,8 @@ class OptionViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFie
         }
         $childContent = $this->renderChildren();
         $this->tag->setContent($childContent);
-        if (!isset($this->arguments['value'])) {
-            $this->tag->addAttribute('value', $childContent);
-        }
+        $value = isset($this->arguments['value']) ? $this->arguments['value'] : $childContent;
+        $this->tag->addAttribute('value', $value);
         $parentRequestedFormTokenFieldName = $this->viewHelperVariableContainer->get(
             SelectViewHelper::class,
             'registerFieldNameForFormTokenGeneration'