[BUGFIX] MetaInformation: Catch InsufficientFolderAccessPermissionsException 30/44130/4
authorMichael Oehlhof <typo3@oehlhof.de>
Sat, 17 Oct 2015 19:08:34 +0000 (21:08 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 18 Oct 2015 17:14:01 +0000 (19:14 +0200)
Resolves: #70815
Releases: master
Change-Id: I31dcabdc34bfff8bd1d992dc7cbeb2e8bc0839c8
Reviewed-on: http://review.typo3.org/44130
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/backend/Classes/Template/Components/MetaInformation.php

index 0490487..3470ab6 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Backend\Template\Components;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException;
 use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Resource\FolderInterface;
@@ -74,7 +75,9 @@ class MetaInformation
                 $resourceObject = ResourceFactory::getInstance()->getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
                 $title = $resourceObject->getStorage()->getName() . ':';
                 $title .= $resourceObject->getParentFolder()->getReadablePath();
-            } catch (ResourceDoesNotExistException $e) {}
+            } catch (ResourceDoesNotExistException $e) {
+            } catch (InsufficientFolderAccessPermissionsException $e) {
+            }
         }
         // Setting the path of the page
         // crop the title to title limit (or 50, if not defined)
@@ -100,6 +103,7 @@ class MetaInformation
         $moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
         $pageRecord = $this->recordArray;
         $uid = '';
+        $title = '';
         $additionalInfo = (!empty($pageRecord['_additional_info']) ? $pageRecord['_additional_info'] : '');
         // Add icon with clickMenu, etc:
         // If there IS a real page
@@ -114,7 +118,8 @@ class MetaInformation
         } elseif (is_array($pageRecord) && !empty($pageRecord['combined_identifier'])) {
             try {
                 $resourceObject = ResourceFactory::getInstance()->getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
-                $title = $resourceObject->getName();
+                $fileMountTitle = $resourceObject->getStorage()->getFileMounts()[$resourceObject->getIdentifier()]['title'];
+                $title = $fileMountTitle ?: $resourceObject->getName();
                 // If this is a folder but not in within file mount boundaries this is the root folder
                 if ($resourceObject instanceof FolderInterface && !$resourceObject->getStorage()->isWithinFileMountBoundaries($resourceObject)) {
                     $iconImg = '<span title="' . htmlspecialchars($title) . '">' . $iconFactory->getIconForResource(