[BUGFIX] Hooks/Signals cannot be used during extension install 55/37955/4
authorOliver Hader <oliver@typo3.org>
Thu, 19 Mar 2015 15:27:42 +0000 (16:27 +0100)
committerNicole Cordes <typo3@cordes.co>
Sun, 5 Apr 2015 21:29:19 +0000 (23:29 +0200)
During the installation of an extension in the extension manager
hooks of the extension to be installed cannot be used currently.
This behavior gets handy if e.g. data to be imported already
should be processed by a custom handler.

By restructuring the process, especially flushing caches and
reloading them, this can be achieved.

Resolves: #65848
Releases: master, 6.2
Change-Id: I89f1fed988377d0a38c6a5908e1a297342754c36
Reviewed-on: http://review.typo3.org/37955
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php

index 65dcd69..fe21dac 100644 (file)
@@ -99,20 +99,21 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         */
        public function install($extensionKey) {
                $extension = $this->enrichExtensionWithDetails($extensionKey);
-               $this->importInitialFiles($extension['siteRelPath'], $extensionKey);
-               $this->processDatabaseUpdates($extension);
                $this->ensureConfiguredDirectoriesExist($extension);
                if (!$this->isLoaded($extensionKey)) {
                        $this->loadExtension($extensionKey);
                }
-               $this->reloadCaches();
-               $this->processRuntimeDatabaseUpdates($extensionKey);
-               $this->saveDefaultConfiguration($extension['key']);
                if (!empty($extension['clearcacheonload']) || !empty($extension['clearCacheOnLoad'])) {
                        $this->cacheManager->flushCaches();
                } else {
                        $this->cacheManager->flushCachesInGroup('system');
                }
+               $this->reloadCaches();
+
+               $this->importInitialFiles($extension['siteRelPath'], $extensionKey);
+               $this->processDatabaseUpdates($extension);
+               $this->processRuntimeDatabaseUpdates($extensionKey);
+               $this->saveDefaultConfiguration($extension['key']);
 
                $this->emitAfterExtensionInstallSignal($extensionKey);
        }