[BUGFIX] Exception in FileMetadataOverlayAspect 14/25914/4
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 3 Dec 2013 14:45:47 +0000 (15:45 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 14 Jan 2014 10:08:18 +0000 (11:08 +0100)
It is possible that PageRepository::getRecordOverlay() returns NULL which
throws an exception as ArrayObject::exchangeArray() either needs an
array or an (array-)object.

The fix adds a small check for the Result of the PageRepository function.

Change-Id: I248125154220e6250c4a2a6fdf29759211bf214b
Resolves: #54169
Releases: 6.2
Reviewed-on: https://review.typo3.org/25914
Reviewed-by: Steffen Ritter
Reviewed-by: Oliver Klee
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/frontend/Classes/Aspect/FileMetadataOverlayAspect.php

index a220378..a90be23 100644 (file)
@@ -27,7 +27,6 @@ namespace TYPO3\CMS\Frontend\Aspect;
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-
 /**
  * Class FileMetadataTranslationAspect
  *
@@ -53,7 +52,9 @@ class FileMetadataOverlayAspect {
                        $this->getTsfe()->sys_language_content,
                        $this->getTsfe()->sys_language_contentOL
                );
-               $data->exchangeArray($overlayedMetaData);
+               if ($overlayedMetaData !== NULL) {
+                       $data->exchangeArray($overlayedMetaData);
+               }
        }
 
        /**