[BUGFIX] Property mapper: Exception not thrown but skipped
authordkd-egerer Sascha Egerer <sascha.egerer@dkd.de>
Fri, 17 Aug 2012 07:11:01 +0000 (09:11 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 17 Aug 2012 21:19:16 +0000 (23:19 +0200)
The transformToObject function in the property mapper
checks for an existing record if an identity is given.
If no record could be found an exception should be thrown.
But the exception will never be thrown due to a wrong
condition. The condition checks for FALSE but NULL is
given.

The Exception does also not exist.

Change-Id: If6ac4d3275718cabab9c94904dad264472630c18
Fixes: #39876
Releases: 1.3, 1.4, 4.7, 6.0
Reviewed-on: http://review.typo3.org/13842
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/extbase/Classes/Property/Mapper.php

index 25307fa..dd3f2a8 100644 (file)
@@ -296,7 +296,7 @@ class Tx_Extbase_Property_Mapper implements t3lib_Singleton {
                        } elseif (is_array($propertyValue)) {
                                if (isset($propertyValue['__identity'])) {
                                        $existingObject = $this->findObjectByUid($targetType, $propertyValue['__identity']);
-                                       if ($existingObject === FALSE) throw new Tx_Extbase_Property_Exception_TargetNotFound('Querying the repository for the specified object was not successful.', 1237305720);
+                                       if ($existingObject === NULL) throw new Tx_Extbase_Property_Exception_InvalidTarget('Querying the repository for the specified object was not successful.', 1237305720);
                                        unset($propertyValue['__identity']);
                                        if (count($propertyValue) === 0) {
                                                $propertyValue = $existingObject;