[BUGFIX] Make textfield view helper handle zero (not empty) values
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 18 Aug 2011 08:15:11 +0000 (10:15 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 18 Aug 2011 08:15:11 +0000 (10:15 +0200)
Values which are 0 (zero) are treated like but are not an empty string.
They need to be handled as normal values (output to be shown in field).

Thanks to Alexander Stehlik.

Change-Id: I7e6f464b281261badd1cc521df3d0f10c4546408
Resolves: #27938

typo3/sysext/fluid/Classes/ViewHelpers/Form/TextfieldViewHelper.php

index 163aed2..32ce08a 100644 (file)
@@ -82,7 +82,7 @@ class Tx_Fluid_ViewHelpers_Form_TextfieldViewHelper extends Tx_Fluid_ViewHelpers
                        $this->tag->addAttribute('placeholder', $placeholder);
                }
 
-               if (!empty($value)) {
+               if ($value !== NULL) {
                        $this->tag->addAttribute('value', $value);
                }