[+BUGFIX] CObjViewHelper: fixed using numeric values as data argument
authorClaus Due <claus@wildsie.dk>
Mon, 16 May 2011 21:51:43 +0000 (23:51 +0200)
committerSebastian Kurfuerst <sebastian@typo3.org>
Thu, 26 May 2011 16:27:57 +0000 (18:27 +0200)
Added a simple extra condition is_numeric() to treat numeric
values the same as string values.

Change-Id: I805fcb37ff17b879d37e9e9e5c657552d4335afd
Fixes: #12891

typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php

index 5191da3..9c914a2 100644 (file)
@@ -93,8 +93,8 @@ class Tx_Fluid_ViewHelpers_CObjectViewHelper extends Tx_Fluid_Core_ViewHelper_Ab
                $currentValue = NULL;
                if (is_object($data)) {
                        $data = Tx_Extbase_Reflection_ObjectAccess::getGettablePropertyNames($data);
-               } elseif (is_string($data)) {
-                       $currentValue = $data;
+               } elseif (is_string($data) || is_numeric($data)) {
+                       $currentValue = (string) $data;
                        $data = array($data);
                }
                $this->contentObject->start($data);