[BUGFIX] Fix calling getInstance() twice to get ResourceFactory 37/57937/3
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 16 Aug 2018 20:55:57 +0000 (22:55 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 16 Aug 2018 21:20:26 +0000 (23:20 +0200)
In the class MetaInformation the ResourceFactory instance is fetched
twice instead of once. Remove one call that is too much.

Resolves: #85880
Releases: master
Change-Id: Ic22b82ff2f68fc2936a0583ae77cb3c0226a0c3d
Reviewed-on: https://review.typo3.org/57937
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Template/Components/MetaInformation.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 3ca6e2d..d167d01 100644 (file)
@@ -66,7 +66,7 @@ class MetaInformation
             }
         } elseif (!empty($pageRecord['combined_identifier'])) {
             try {
-                $resourceObject = ResourceFactory::getInstance()->getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
+                $resourceObject = ResourceFactory::getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
                 $title = $resourceObject->getStorage()->getName() . ':';
                 $title .= $resourceObject->getParentFolder()->getReadablePath();
             } catch (ResourceDoesNotExistException $e) {
@@ -195,7 +195,7 @@ class MetaInformation
         } elseif (is_array($pageRecord) && !empty($pageRecord['combined_identifier'])) {
             // If the module is about a FAL resource
             try {
-                $resourceObject = ResourceFactory::getInstance()->getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
+                $resourceObject = ResourceFactory::getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
                 $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
index 64a688e..d8fbb3b 100644 (file)
@@ -1575,7 +1575,7 @@ class ResourceStorage implements ResourceStorageInterface
                 if (empty($processingFolderIdentifier) || (int)$storageUid !== $this->getUid()) {
                     continue;
                 }
-                $potentialProcessingFolder = $this->getResourceFactoryInstance()->getInstance()->createFolderObject($this, $processingFolderIdentifier, $processingFolderIdentifier);
+                $potentialProcessingFolder = $this->getResourceFactoryInstance()->createFolderObject($this, $processingFolderIdentifier, $processingFolderIdentifier);
                 if ($potentialProcessingFolder->getStorage() === $this && $potentialProcessingFolder->getIdentifier() !== $this->getProcessingFolder()->getIdentifier()) {
                     $this->processingFolders[] = $potentialProcessingFolder;
                 }