[BUGFIX] Do not use scalar value as an array. 69/32869/2
authorChetan Thapliyal <chetan.thapliyal@aoe.com>
Thu, 18 Sep 2014 14:37:46 +0000 (16:37 +0200)
committerChetan Thapliyal <nospam.ct@gmail.com>
Thu, 18 Sep 2014 14:39:26 +0000 (16:39 +0200)
Change-Id: I2afa0b0d1222abb4296e2520ba427a0e7c819459
Reviewed-on: http://review.typo3.org/32869
Reviewed-by: Chetan Thapliyal <nospam.ct@gmail.com>
Tested-by: Chetan Thapliyal <nospam.ct@gmail.com>
hooks/class.tx_languagevisibility_hooks_t3lib_page.php

index 71accde..f3d93b6 100644 (file)
@@ -47,20 +47,20 @@ class tx_languagevisibility_hooks_t3lib_page implements \TYPO3\CMS\Frontend\Page
        public function getPageOverlay_preProcess(&$pageInput, &$lUid, \TYPO3\CMS\Frontend\Page\PageRepository $parent) {
                if (is_int($pageInput)) {
                        $page_id = $pageInput;
-               } elseif ( is_array($pageInput) && isset($pageInput['uid']) ) {
+               } elseif (is_array($pageInput) && isset($pageInput['uid'])) {
                        $page_id = $pageInput['uid'];
                } else {
                        return;
                }
 
-                       //call service to know if element is visible and which overlay language to use
+                       // call service to know if element is visible and which overlay language to use
                $overlayLanguage = tx_languagevisibility_feservices::getOverlayLanguageIdForElementRecord($page_id, 'pages', $lUid);
                if ($overlayLanguage === FALSE) {
                        $overlayLanguageForced = tx_languagevisibility_feservices::getOverlayLanguageIdForElementRecordForced($page_id, 'pages', $lUid);
                                // don't use this recursion without further checks!!!!
                                // this isn't used because there  seems to be no reason why we should overlay an invisible page...
                                // $pageInput = $parent->getPageOverlay ( &$pageInput, $overlayLanguageForced );
-                       $pageInput['_NOTVISIBLE'] = TRUE;
+                       if (is_array($pageInput)) $pageInput['_NOTVISIBLE'] = TRUE;
                        $lUid = NULL;
                } else {
                        $lUid = $overlayLanguage;