[+BUGFIX] (Property) Fixed only adding objects to ObjectStorage
authorMarc Bastian Heinrichs <heinrichs@mbh-web.de>
Sun, 6 Mar 2011 18:06:53 +0000 (19:06 +0100)
committerSebastian Kurfuerst <sebastian@typo3.org>
Thu, 9 Jun 2011 12:16:53 +0000 (14:16 +0200)
The method transformToObject could return NULL, when value could not
be transformed. NULL should not be attached to ArrayObject or
ObjectStorage. Thanks to Thomas Maroschik.

Fixes: #13288

Change-Id: I3ac53571f831229d77ca6a228df4d91bb6cd5f77

typo3/sysext/extbase/Classes/Property/Mapper.php

index ed09b2c..15c5bbe 100644 (file)
@@ -226,7 +226,10 @@ class Tx_Extbase_Property_Mapper implements t3lib_Singleton {
                                                $objects = array();
                                                if (is_array($propertyValue)) {
                                                        foreach ($propertyValue as $value) {
-                                                               $objects[] = $this->transformToObject($value, $propertyMetaData['elementType'], $propertyName);
+                                                               $transformedObject = $this->transformToObject($value, $propertyMetaData['elementType'], $propertyName);
+                                                               if ($transformedObject !== NULL) {
+                                                                       $objects[] = $transformedObject;
+                                                               }
                                                        }
                                                }