Bug #22280
closedTypo3_mainDir not resolved when using rlmp_eventdb
0%
Description
If I use the following skript from Robert Lemkes event_db I get by executing the following code:
require_once(PATH_t3lib.'config_default.php');
this error message:
Warning: require_once(../../../../TYPO3_mainDirsysext/lang/lang.php)
[function.require-once]: failed to open stream: No such file or
directory in /www/htdocs/w00c53fb/Website/t3lib/config_default.php on
line 568
Fatal error: require_once() [function.require]: Failed opening required
'../../../../TYPO3_mainDirsysext/lang/lang.php'
(include_path='.:/usr/share/php:..') in
/www/htdocs/w00c53fb/Website/t3lib/config_default.php on line 568
In my opinion this happens, because the constant TYPO3_mainDir, definied in typo3/init.php, is not resolved properly.
The path is defined in class.tslib_extmgm.php at line 148 function extPath(...)
My workaround for now ist to change the function to:
public static function extPath($key, $script = '') {
global $TYPO3_LOADED_EXT;
if (!isset($TYPO3_LOADED_EXT[$key])) {
#debug(array(debug_backtrace()));
die('TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded! (t3lib_extMgm::extPath)');
}
if (substr($TYPO3_LOADED_EXT[$key]['siteRelPath'],0,13) == 'TYPO3_mainDir') {
$modSiteRelPath = str_replace('TYPO3_mainDir','typo3/',$TYPO3_LOADED_EXT[$key]['siteRelPath']);
return PATH_site.$modSiteRelPath.$script;
} else {
return PATH_site.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$script;
}
}
It's a kind of fallback for those calls of that function, where TYPO3_mainDir will not be defined before executing class.tslib_extmgm.php.
The error occures only in Typo3 4.3x, in Typo3 4.2x the script from Lemke works properly. For the script see attached file.
If it's now really a bug or if just something changed in typo3-core, I don't know and therefore I'm reporting it here.
(issue imported from #M13816)
Files