[BUGFIX] Image Content elements result in exception 97/42897/4
authorDaniel Maier <dani-maier@gmx.de>
Thu, 27 Aug 2015 22:16:05 +0000 (00:16 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 28 Aug 2015 12:46:11 +0000 (14:46 +0200)
With the change introduced in #66204, the fileObject-uid only was
determined if fileObject is instace of AbstractFile. As the uid
needs also be determined correctly for FileReferences, a more
general approach is needed to check if the getUid method exists
for the given fileObject type.

Resolves: #69377
Related: #66204
Releases: master
Change-Id: Ia837b4706ae4c7f38446751eb8c800d4fad8c8e4
Reviewed-on: http://review.typo3.org/42897
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Sebastian Michaelsen <michaelsen@t3seo.de>
Tested-by: Sebastian Michaelsen <michaelsen@t3seo.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index d5d8672..48e550d 100755 (executable)
@@ -5841,7 +5841,7 @@ class ContentObjectRenderer {
                                case 'name':
                                        return $fileObject->getName();
                                case 'uid':
-                                       if ($fileObject instanceof AbstractFile) {
+                                       if (method_exists($fileObject, 'getUid')) {
                                                return $fileObject->getUid();
                                        }
                                        return 0;