Project

General

Profile

Actions

Bug #22645

closed

Uncaught exception 'BadFunctionCallException'

Added by Franz Holzinger over 14 years ago. Updated almost 10 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-05-13
Due date:
% Done:

0%

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

Description

I have just wanted to install tt_products. Then the backend has gone with an error message.

Fatal error: Uncaught exception 'BadFunctionCallException' with message 'TYPO3 Fatal Error: Extension key "tt_products" was NOT loaded!' in xyz/trunk/t3lib/class.t3lib_extmgm.php:156 Stack trace: #0 xyz/typo3conf/temp_CACHED_ps10dd_ext_localconf.php(2321): t3lib_extMgm::extPath('tt_products') #1 xyz/t3lib/config_default.php(590): require('xyz/...') #2 xyz/trunk/typo3/init.php(194): require(xyz/...') #3 xyz/trunk/typo3/mod/tools/em/index.php(40): require(xyz/...') #4 {main} thrown in xyz/trunk/t3lib/class.t3lib_extmgm.php on line 156

(issue imported from #M14380)

Actions #1

Updated by Franz Holzinger over 14 years ago

There are calls in the file ext_localconf.php of extensions, e.g. tt_products:

if (!defined ('PATH_BE_ttproducts')) {
define('PATH_BE_ttproducts', t3lib_extMgm::extPath(TT_PRODUCTS_EXTkey));
}

This is to have a constant for the path to the extension in the backend. $TYPO3_LOADED_EXT['tt_products'] is not yet true, because tt_products is in the process to be loaded. So it must also be checked if the global $_EXTKEY == 'tt_product' and not to raise an exception. And the second bug is that this exception is not caught anywhere.

public static function extPath($key, $script = '') {
global $TYPO3_LOADED_EXT;
if (!isset($TYPO3_LOADED_EXT[$key])) {
throw new BadFunctionCallException(
'TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded!',
1270853878
);
}
return PATH_site.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$script;
}

Actions #2

Updated by Steffen Gebert over 14 years ago

It seems like you shouldn't do such things in ext_localconf.php, when the extension isn't loaded, yet.
Therefore it's okay to throw an exception.

Did this work with 4.3? I think exceptions only took over places where before printError() messages have been shown.

Actions #3

Updated by Franz Holzinger over 14 years ago

Yes, this is allowed in former versions of extensions.

I have found now the reason for this error now.
I have had a renaming error. The folder name for tt_products has been tt_product. This error has occured due to this wrong name of the folder name of the extension.

The only thing which is needed here is that this exception should be caught. It is the wrong way to block everything because of a simple naming error.

Actions #4

Updated by Steffen Kamper over 14 years ago

it was a die before, so only difference is that you get more informations now.

I close this bug report.

Actions #5

Updated by Franz Holzinger about 12 years ago

This error (white TYPO3 backend without any displayed error message) is still present in TYPO3 4.7.2.

PHP error_log:

[Mon Oct 29 07:39:25 2012] [error] [client 42.28.98.142] PHP Fatal error: Uncaught exception 'BadFunctionCallException' with message 'TYPO3 Fatal Error: Extension "tt_products" was NOT found!' in /var/www/mydomain/web/typo3_src-4.7.2/t3lib/class.t3lib_extmgm.php:105\nStack trace:\n#0 /var/www/mydomain/web/typo3_src-4.7.2/t3lib/class.t3lib_autoloader.php(171): t3lib_extMgm::extPath('tt_products', 'ext_autoload.ph...')\n#1 /var/www/mydomain/web/typo3_src-4.7.2/t3lib/class.t3lib_autoloader.php(121): t3lib_autoloader::createCoreAndExtensionRegistry()\n#2 /var/www/mydomain/web/typo3_src-4.7.2/t3lib/class.t3lib_autoloader.php(69): t3lib_autoloader::loadCoreAndExtensionRegistry()\n#3 /var/www/mydomain/web/typo3_src-4.7.2/t3lib/config_default.php(799): t3lib_autoloader::registerAutoloader()\n#4 /var/www/mydomain/web/typo3_src-4.7.2/typo3/init.php(201): require('/var/www/mydomain/...')\n#5 /var/www/mydomain/web/typo3_src-4.7.2/typo3/index.php(38): require('/var/www/mydomain/...')\n#6 {main}\n thrown in /var/www/mydomain/web/typo3_src-4.7.2/t3lib/class.t3lib_extmgm.php on line 105

Actions #6

Updated by Jigal van Hemert about 12 years ago

  • Status changed from Closed to New
  • Target version deleted (0)
  • TYPO3 Version set to 4.7
Actions #7

Updated by Ernesto Baschny about 12 years ago

  • Status changed from New to Needs Feedback

As far as I understand from the comments 2 years ago:

You mistakenly renamed your directory from "tt_products" to "tt_product"
which is why the error popped up.

In previous TYPO3 versions (I guess <4.5?) there was a "die()" at this
point in extPath() function, where now an "extension" is thrown.

This is why Steffen Kamper closed the issue with the comment:

it was a die before, so only difference is that you get more
informations now.
I close this bug report.

So I guess this is all true. What kind of "exception handling" do you
expect at this point instead? The exception in production is logging, in
development mode you probably will see the whole stack trace of the
situation. So I guess there is nothing else the core should do.

Or do I miss something?

Actions #8

Updated by Franz Holzinger about 12 years ago

These things are missing:

1. The TYPO3 backend should never go away if it does not find an extension which formerly has been installed. The extension is not needed at all to have a working TYPO3 backend. There is no need at all to stop here.

2. The TYPO3 frontend should not show a white page when something is wrong. It should at least point the user into the right direction. It could say 'TYPO3 Fatal Error: Extension key "tt_products" was NOT loaded! Check your log file for more information.' Why should the user not be informed about this?

Actions #9

Updated by Alexander Opitz over 11 years ago

  • Status changed from Needs Feedback to New
Actions #10

Updated by Christian Kuhn almost 10 years ago

  • Status changed from New to Rejected
  • Is Regression set to No

due to the limitations of the ext_localconf and ext_tables concept - php by extensions in early bootstrap - it can not be changed that an extension kills the frontend and the backend. proper error messages are generated in delevopment mode, in production a "blank page" will be shown in order to not expose system details in the wild for security reasons.

this issue here will now be set to rejected since nothing in this area can be changed for the time being.

Actions

Also available in: Atom PDF