[TASK] Show expected targetType on "Object not found" errors 41/40141/3
authorMathias Brodala <mbrodala@pagemachine.de>
Wed, 10 Jun 2015 07:06:11 +0000 (09:06 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 18 Jun 2015 19:30:02 +0000 (21:30 +0200)
If the ``PersistentObjectConverter`` cannot find an object by
given identity the error message shows the identity but not the
expected object type. Adding it helps a lot in debugging such errors.

Resolves: #67382
Releases: master
Change-Id: Ib13e1e7927b2b56cb6c23555608703dfcda060b9
Reviewed-on: http://review.typo3.org/40141
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/extbase/Classes/Property/TypeConverter/PersistentObjectConverter.php

index 708e232..2144296 100644 (file)
@@ -207,7 +207,7 @@ class PersistentObjectConverter extends ObjectConverter {
                }
 
                if ($object === NULL) {
-                       throw new \TYPO3\CMS\Extbase\Property\Exception\TargetNotFoundException('Object with identity "' . print_r($identity, TRUE) . '" not found.', 1297933823);
+                       throw new \TYPO3\CMS\Extbase\Property\Exception\TargetNotFoundException(sprintf('Object of type %s with identity "%s" not found.', $targetType, print_r($identity, TRUE)), 1297933823);
                }
 
                return $object;