[BUGFIX] Only clear cache if you have access to the page 70/48670/6
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 24 Jun 2016 12:18:57 +0000 (14:18 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 4 Jul 2016 19:41:35 +0000 (21:41 +0200)
Resolves: #76786
Releases: master
Change-Id: I601bcdc46a9d7c569152857880445bcd8e510c1b
Reviewed-on: https://review.typo3.org/48670
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Tree/Pagetree/ExtdirectTreeCommands.php

index f863ae6..2a9e3b3 100755 (executable)
@@ -479,10 +479,10 @@ class PageLayoutController
      */
     public function clearCache()
     {
      */
     public function clearCache()
     {
-        if ($this->clear_cache) {
-            $tce = GeneralUtility::makeInstance(DataHandler::class);
-            $tce->start(array(), array());
-            $tce->clear_cacheCmd($this->id);
+        if ($this->clear_cache && !empty($this->pageinfo)) {
+            $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
+            $dataHandler->start(array(), array());
+            $dataHandler->clear_cacheCmd($this->id);
         }
     }
 
         }
     }
 
index 95b2301..f4fbc7f 100644 (file)
@@ -165,9 +165,14 @@ class ExtdirectTreeCommands
     public static function clearCacheOfPage($nodeData)
     {
         $node = GeneralUtility::makeInstance(PagetreeNode::class, (array)$nodeData);
     public static function clearCacheOfPage($nodeData)
     {
         $node = GeneralUtility::makeInstance(PagetreeNode::class, (array)$nodeData);
-        $tce = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
-        $tce->start(array(), array());
-        $tce->clear_cacheCmd($node->getId());
+
+        $permissionClause = static::getBackendUser()->getPagePermsClause(1);
+        $access = BackendUtility::readPageAccess($node->getId(), $permissionClause);
+        if ($access) {
+            $dataHandler = GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
+            $dataHandler->start(array(), array());
+            $dataHandler->clear_cacheCmd($node->getId());
+        }
     }
 
     /**
     }
 
     /**