Fixed bug #9981: EM does not test for usage of mod.php-API and spuriously displays...
authorOliver Hader <oliver.hader@typo3.org>
Wed, 25 Nov 2009 08:50:17 +0000 (08:50 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 25 Nov 2009 08:50:17 +0000 (08:50 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6520 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/mod/tools/em/class.em_index.php
typo3/sysext/lang/locallang_mod_tools_em.xml

index e42e190..39ad428 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-11-25  Oliver Hader  <oliver@typo3.org>
 
        * Follow-up to bugfix #12436: Move Suhosin part to php.ini section in the install tool
+       * Fixed bug #9981: EM does not test for usage of mod.php-API and spuriously displays an error (thanks to Andreas Kundoch)
 
 2009-11-24  Stanislas Rolland  <typo3@sjbr.ca>
 
index 869c4c3..bb19f94 100644 (file)
@@ -4555,6 +4555,7 @@ EXTENSION KEYS:
 
                $flag_M = 0;
                $flag_B = 0;
+               $flag_Dispatch = 0;
 
                foreach($lines as $k => $l)     {
                        $line = trim($l);
@@ -4566,16 +4567,29 @@ EXTENSION KEYS:
                        }
 
                        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]);
-                               $flag_B = $k+1;
+                       if (preg_match('/^\$BACK_PATH[[:space:]]*=[[:space:]]*["\']([[:alnum:]_\/\.]+)["\'][[:space:]]*;/', $line, $reg)) {
+                               $lines[$k] = str_replace($reg[0], '$BACK_PATH=\'' . $this->typeBackPaths[$type] . '\';', $lines[$k]);
+                               $flag_B = $k + 1;
                        }
+
+                               // Check if this module uses new API (see http://bugs.typo3.org/view.php?id=5278)
+                               // where TYPO3_MOD_PATH and BACK_PATH are not required
+                       unset($reg);
+                       if (preg_match('/^\$MCONF\[["\']script["\']\][[:space:]]*=[[:space:]]*["\']_DISPATCH["\'][[:space:]]*;/', $line, $reg)) {
+                               $flag_Dispatch = $k+1;
+                       }
+
                }
 
                if ($flag_B && $flag_M) {
                        t3lib_div::writeFile($confFilePath,implode(chr(10),$lines));
                        return sprintf($GLOBALS['LANG']->getLL('writeModPath_ok'),
                                substr($confFilePath, strlen(PATH_site)));
+               } elseif ($flag_Dispatch){
+                       return sprintf(
+                               $GLOBALS['LANG']->getLL('writeModPath_notRequired'),
+                               substr($confFilePath, strlen(PATH_site))
+                       );
                } else return $GLOBALS["TBE_TEMPLATE"]->rfw(
                        sprintf($GLOBALS['LANG']->getLL('writeModPath_error'),
                        $confFilePath)
index dc87a66..c164b95 100755 (executable)
                        <label index="clearMakeExtDir_could_not_create_dir">ERROR: Could not create extension directory "%s"!</label>
                        <label index="clearMakeExtDir_no_dir">ERROR: The extension install path "%s" was no directory!</label>
                        <label index="writeModPath_ok">TYPO3_MOD_PATH and $BACK_PATH were updated in "%s"!</label>
+                       <label index="writeModPath_notRequired">Notice: Module "%s" uses module-API to register module, TYPO3_MOD_PATH and $BACK_PATH not required.</label>
                        <label index="writeModPath_error">Error: Either TYPO3_MOD_PATH or $BACK_PATH was not found in the "%s" file. You must manually configure that!</label>
                        <label index="updateLocalEM_CONF_ok">The file "%s" was updated with a cleaned up EM_CONF array.</label>
                        <label index="updateLocalEM_CONF_not_writable">Error: "%s" was not writable!</label>