Project

General

Profile

Actions

Bug #22280

closed

Typo3_mainDir not resolved when using rlmp_eventdb

Added by Joe Lipps over 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-03-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

rlmp_eventdb_print.php (3.25 KB) rlmp_eventdb_print.php Administrator Admin, 2010-03-15 12:27
Actions #1

Updated by Chris topher over 14 years ago

$TYPO3_LOADED_EXT[$key]['siteRelPath'] is set in config_default.php:
$TYPO3_LOADED_EXT[$key]['siteRelPath'] = t3lib_extMgm::typo3_loadExtensions()
This then returns
$extensions[$temp_extKey] = array(
...
'siteRelPath'=>TYPO3_mainDir.'sysext/'.$temp_extKey.'/',
...
);

Is typo3/init.php not included so that TYPO3_mainDir is not set? Strange...

Well, since this works without problems with other extensions, this must be a bug in rlmp_eventdb. The extension was last updated in 2008 and might just be incompatible with TYPO3 4.3.
It would be great, if you could inform Robert Lemke, so that he can release a bug fix...

Actions

Also available in: Atom PDF