[BUGFIX] Installing extension throws error
authorandreaswolf <andreaswolf@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 9 Aug 2011 18:04:03 +0000 (18:04 +0000)
committerandreaswolf <andreaswolf@735d13b6-9817-0410-8766-e36946ffe9aa>
Tue, 9 Aug 2011 18:04:03 +0000 (18:04 +0000)
Because the class.ext_update.php script tries to use classes from the extension, it dies with a fatal error when trying to install the extension via the Extension Manager. This commit adds a check for the install status of the extension.

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/identity/trunk@50826 735d13b6-9817-0410-8766-e36946ffe9aa

class.ext_update.php

index 31acc7e..1adf60d 100644 (file)
@@ -23,7 +23,9 @@
  *  This copyright notice MUST APPEAR in all copies of the script!
  * ************************************************************* */
 
-require_once(t3lib_extMgm::extPath('identity') . 'Classes/Install/Installer.php');
+if (t3lib_extMgm::isLoaded('identity')) {
+       require_once(t3lib_extMgm::extPath('identity') . 'Classes/Install/Installer.php');
+}
 
 /**
  * Class for updating identity
@@ -50,10 +52,12 @@ class ext_update {
         *
         */
        public function __construct() {
-                       // instantiate a light installer
-                       /* @var $this->installer Tx_Identity_Install_Installer */
-               $this->installer = t3lib_div::makeInstance('Tx_Identity_Install_Installer');
-               $this->identityMap = t3lib_div::makeInstance('Tx_Identity_Map');
+               if (t3lib_extMgm::isLoaded('identity')) {
+                               // instantiate a light installer
+                               /* @var $this->installer Tx_Identity_Install_Installer */
+                       $this->installer = t3lib_div::makeInstance('Tx_Identity_Install_Installer');
+                       $this->identityMap = t3lib_div::makeInstance('Tx_Identity_Map');
+               }
        }
 
        /**
@@ -62,6 +66,9 @@ class ext_update {
         * @return      string  HTML to display
         */
        public function main() {
+               if (!t3lib_extMgm::isLoaded('identity')) {
+                       return '';
+               }
 
                $statements = $this->getStatements();