[TASK] Remove undefined property iconFactory from EditFileController 97/50597/3
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 11 Nov 2016 18:57:29 +0000 (19:57 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sat, 12 Nov 2016 06:18:27 +0000 (07:18 +0100)
The property is not defined at all. We can retrieve the iconFactory
from the moduleTemplate.

Resolves: #78662
Releases: master
Change-Id: Id51ac702b9a9e57d731014e86e1637632aadcb38
Reviewed-on: https://review.typo3.org/50597
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Controller/File/EditFileController.php

index 5bad23a..4a041ab 100644 (file)
@@ -21,7 +21,6 @@ use TYPO3\CMS\Backend\Template\Components\ButtonBar;
 use TYPO3\CMS\Backend\Template\DocumentTemplate;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Imaging\Icon;
-use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -84,7 +83,6 @@ class EditFileController extends AbstractModule
     public function __construct()
     {
         parent::__construct();
-        $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
         $GLOBALS['SOBE'] = $this;
         $this->init();
     }
@@ -120,7 +118,7 @@ class EditFileController extends AbstractModule
         }
 
         // Setting the title and the icon
-        $icon = $this->iconFactory->getIcon('apps-filetree-root', Icon::SIZE_SMALL)->render();
+        $icon = $this->moduleTemplate->getIconFactory()->getIcon('apps-filetree-root', Icon::SIZE_SMALL)->render();
         $this->title = $icon
             . htmlspecialchars(
                 $this->fileObject->getStorage()->getName()