Fixed bug #17244: Error Message while Updating 4.4.6 > 4.5
authorOliver Hader <oliver.hader@typo3.org>
Thu, 17 Feb 2011 11:33:30 +0000 (11:33 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 17 Feb 2011 11:33:30 +0000 (11:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-5@10479 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_extmgm.php
t3lib/config_default.php
tests/t3lib/t3lib_extmgmTest.php

index 7d301a7..167dac7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2011-02-17  Oliver Hader  <oliver.hader@typo3.org>
 
        * Fixed bug #17355: Dependencies in sysext 'version' and 'workspaces'
+       * Fixed bug #17244: Error Message while Updating 4.4.6 > 4.5
 
 2011-02-16  Ernesto Baschny  <ernst@cron-it.de>
 
index d91b24b..defdf59 100644 (file)
@@ -1589,10 +1589,46 @@ $TYPO3_LOADED_EXT = unserialize(stripslashes(\'' . addslashes(serialize($extensi
                        $extLoadInContext = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'];
                }
 
-               $extensionList = $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] . ',' . $extLoadInContext;
+               $extensionList = self::getRequiredExtensionList() . ',' . $extLoadInContext;
+               $ignoredExtensionList = self::getIgnoredExtensionList();
+
+                       // Remove the extensions to be ignored:
+               if ($ignoredExtensionList && (defined('TYPO3_enterInstallScript') && TYPO3_enterInstallScript) === FALSE) {
+                       $extensions = array_diff(
+                               explode(',', $extensionList),
+                               explode(',', $ignoredExtensionList)
+                       );
+                       $extensionList = implode(',', $extensions);
+               }
 
                return $extensionList;
        }
+
+       /**
+        * Gets the list of required extensions.
+        *
+        * @return string
+        */
+       public static function getRequiredExtensionList() {
+               $requiredExtensionList = t3lib_div::uniqueList(
+                       REQUIRED_EXTENSIONS . ',' . $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt']
+               );
+
+               return $requiredExtensionList;
+       }
+
+       /**
+        * Gets the list of extensions to be ignored (not to be loaded).
+        *
+        * @return string
+        */
+       public static function getIgnoredExtensionList() {
+               $ignoredExtensionList = t3lib_div::uniqueList(
+                       $GLOBALS['TYPO3_CONF_VARS']['EXT']['ignoredExt']
+               );
+
+               return $ignoredExtensionList;
+       }
 }
 
 ?>
index 2844f6f..cbefacb 100644 (file)
@@ -22,6 +22,9 @@ define('FILE_DENY_PATTERN_DEFAULT', '\.(php[3-6]?|phpsh|phtml)(\..*)?$|^\.htacce
 //Security related constant: Comma separated list of file extensions that should be registered as php script file extensions
 define('PHP_EXTENSIONS_DEFAULT', 'php,php3,php4,php5,php6,phpsh,inc,phtml');
 
+// Defines a list that are basically required by a TYPO3 system.
+define('REQUIRED_EXTENSIONS', 'cms,lang,sv,em,recordlist');
+
 $TYPO3_CONF_VARS = array(
        'GFX' => array(         // Configuration of the image processing features in TYPO3. 'IM' and 'GD' are short for ImageMagick and GD library respectively.
                'image_processing' => TRUE,                             // Boolean: Enables image processing features. Disabling this means NO image processing with either GD or IM!
@@ -171,7 +174,8 @@ $TYPO3_CONF_VARS = array(
                'em_wsdlURL' => 'http://typo3.org/wsdl/tx_ter_wsdl.php',                                // The SOAP URL for uploading extensions to the TER2. Usually doesn't need to be changed.
                'em_mirrorListURL' => 'http://repositories.typo3.org/mirrors.xml.gz',                           // Allows to preset the URL for fetching the extension repository mirror list from. Used in the Extension Manager.
 
-               'requiredExt' => 'cms,lang,sv,em,recordlist',           // String (exclude). List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
+               'requiredExt' => '',            // String. List of additional extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
+               'ignoredExt' => '',                     // String. List of extensions to be ignored (not loaded), e.g. "em" can be disabled this way.
                'excludeForPackaging' => '(CVS|\..*|.*~|.*\.bak)',              // String: List of directories and files which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. Perl regular expression syntax!
                'extCache' => 1,                                                // <p>Integer (0, 1, 2, 3)</p><dl><dt>0</dt><dd>ext-scripts (ext_localconf.php and ext_tables.php) are NOT cached, but included every time</dd><dt>1</dt><dd>scripts cached to typo3conf/temp_CACHED_[sitePathHash]* (saves some milliseconds even with PHP accelerators)</dd><dt>2</dt><dd>scripts cached and prefix includes a hash based on the 'extList' string</dd><dt>3</dt><dd>scripts cached to typo3conf/temp_CACHED_* (no hash included at all...)</dd></dl>
                'extList' => 'filelist,version,tsconfig_help,context_help,extra_page_cm_options,impexp,belog,about,cshmanual,aboutmodules,setup,opendocs,install,t3editor,felogin,feedit,recycler',                                             // String (exclude) List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this!
index 8efcb89..fb162cf 100644 (file)
@@ -41,6 +41,7 @@ class t3lib_extmgmTest extends tx_phpunit_testcase {
 
        public function setUp() {
                $this->globals = array(
+                       'TYPO3_CONF_VARS' => serialize($GLOBALS['TYPO3_CONF_VARS']),
                        'TYPO3_LOADED_EXT' => serialize($GLOBALS['TYPO3_LOADED_EXT']),
                        'TCA' => serialize($GLOBALS['TCA']),
                );
@@ -472,5 +473,30 @@ class t3lib_extmgmTest extends tx_phpunit_testcase {
                        t3lib_extMgm::getExtensionVersion($extensionKey)
                );
        }
+
+       /**
+        * @test
+        */
+       public function getEnabledExtensionListConsidersRequiredExtensions() {
+               $testrequiRedExtension = uniqid('test');
+               $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] = $testrequiRedExtension;
+
+               $extensions = explode(',', t3lib_extMgm::getEnabledExtensionList());
+               $this->assertTrue(in_array($testrequiRedExtension, $extensions));
+       }
+
+       /**
+        * @test
+        */
+       public function getEnabledExtensionListConsidersRequiredAndIgnoredExtensions() {
+               $testRequiredExtension = uniqid('test');
+               $testIgnoredExtension = uniqid('test');
+               $GLOBALS['TYPO3_CONF_VARS']['EXT']['requiredExt'] = $testRequiredExtension . ',' . $testIgnoredExtension;
+               $GLOBALS['TYPO3_CONF_VARS']['EXT']['ignoredExt'] = $testIgnoredExtension;
+
+               $extensions = explode(',', t3lib_extMgm::getEnabledExtensionList());
+               $this->assertTrue(in_array($testRequiredExtension, $extensions));
+               $this->assertFalse(in_array($testIgnoredExtension, $extensions));
+       }
 }
 ?>
\ No newline at end of file