Fixed bug #16495: conf.php files aren't corrected when installing extensions
authorJigal van Hemert <jigal@xs4all.nl>
Mon, 22 Nov 2010 19:06:11 +0000 (19:06 +0000)
committerJigal van Hemert <jigal@xs4all.nl>
Mon, 22 Nov 2010 19:06:11 +0000 (19:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9502 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/em/classes/install/class.tx_em_install.php
typo3/sysext/em/classes/tools/class.tx_em_tools.php

index 1fd6a33..eca6540 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 2010-11-20  Jigal van Hemert  <jigal@xs4all.nl>
 
        * Fixed bug #16322: Incorrect regexp in substituteMarkerArray
-
+       * Fixed bug #16495: conf.php files aren't corrected when installing extensions
+                       
 2010-11-22  Ingo Renner  <ingo@typo3.org>
 
        * Fixed bug #16507: stdWrap unavailable after refactoring of tslib_content
index 486cc75..6fe36c0 100644 (file)
@@ -184,7 +184,7 @@ class tx_em_Install {
                                                                                                foreach ($modules as $mD) {
                                                                                                        $confFileName = $extDirPath . $mD . '/conf.php';
                                                                                                        if (@is_file($confFileName)) {
-                                                                                                               $messageContent .= tx_em_Tools::writeTYPO3_MOD_PATH($confFileName, $loc, $extKey . '/' . $mD . '/') . '<br />';
+                                                                                                               $messageContent .= tx_em_Tools::writeTYPO3_MOD_PATH($confFileName, $loc, $extKey . '/' . $mD . '/', $this->parentObject->typeRelPaths, $this->parentObject->typeBackPaths) . '<br />';
                                                                                                        } else {
                                                                                                                $messageContent .= sprintf($GLOBALS['LANG']->getLL('ext_import_no_conf_file'),
                                                                                                                        $confFileName) . '<br />';
index f074e39..0b45678 100644 (file)
@@ -873,11 +873,13 @@ final class tx_em_Tools {
         *
         * @param       string          Absolute path to a "conf.php" file of the backend module which we want to write back to.
         * @param       string          Install scope type: L, G, S
-        * @param       string          Relative path for the module folder in extenson
+        * @param       string          Relative path for the module folder in extension
+        * @param   array       Array of relative paths per install scope type
+        * @param   array       Array of back paths per install scope type
         * @return      string          Returns message about the status.
         * @see modConfFileAnalysis()
         */
-       function writeTYPO3_MOD_PATH($confFilePath, $type, $mP) {
+       function writeTYPO3_MOD_PATH($confFilePath, $type, $mP, array $typeRelativePaths, array $typeBackPaths) {
                $lines = explode(LF, t3lib_div::getUrl($confFilePath));
                $confFileInfo = array();
                $confFileInfo['lines'] = $lines;
@@ -892,13 +894,13 @@ final class tx_em_Tools {
 
                        unset($reg);
                        if (preg_match('/^define[[:space:]]*\([[:space:]]*["\']TYPO3_MOD_PATH["\'][[:space:]]*,[[:space:]]*["\']([[:alnum:]_\/\.]+)["\'][[:space:]]*\)[[:space:]]*;/', $line, $reg)) {
-                               $lines[$k] = str_replace($reg[0], 'define(\'TYPO3_MOD_PATH\', \'' . $this->typeRelPaths[$type] . $mP . '\');', $lines[$k]);
+                               $lines[$k] = str_replace($reg[0], 'define(\'TYPO3_MOD_PATH\', \'' . $typeRelativePaths[$type] . $mP . '\');', $lines[$k]);
                                $flag_M = $k + 1;
                        }
 
                        unset($reg);
                        if (preg_match('/^\$BACK_PATH[[:space:]]*=[[:space:]]*["\']([[:alnum:]_\/\.]+)["\'][[:space:]]*;/', $line, $reg)) {
-                               $lines[$k] = str_replace($reg[0], '$BACK_PATH=\'' . $this->typeBackPaths[$type] . '\';', $lines[$k]);
+                               $lines[$k] = str_replace($reg[0], '$BACK_PATH=\'' . $typeBackPaths[$type] . '\';', $lines[$k]);
                                $flag_B = $k + 1;
                        }