Issue Bug Closed

#67221DataHandler class generates a name collision

Stefan Gruber 06/01/15, 12:19 updated 10/02/18, 11:44

Description

Under some circumstances class loading fails with the following error:

PHP Fatal error:  Cannot use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtility because the name is already in use in /var/www/t3_plansee/htdocs/typo3conf/ext/news/Classes/Hooks/DataHandler.php on line 18

This is because of line 18 in the DataHandler.php: use TYPO3\CMS\Backend\Utility\BackendUtility

After removing line 18 and replacing the BackendUtility class with the full qualified name it works.

One way to produce this error is to call l10nmgr import cli with php-cgi:
@“php-cgi” -q -e -d register_argc_argv=1 “cli_dispatch.phpsh” l10nmgr_import —task importFile —preview 1 —file trans.xml —server “http://URL/”@

The error occures in the TYPO3\CMS\Core\Core\ClassLoader->loadClass() method in line 197 (typo3 6.2.12:

|| (bool)require_once $classLoadingInformation[0];):
        if (!empty($classLoadingInformation)) {
               // The call to class_exists/interface_exists fixes a rare case when early instances need to be aliased
               // but PHP fails to recognize the real path of the class. See #55904
               $loadingSuccessful = class_exists($classLoadingInformation[1], FALSE)
                      || interface_exists($classLoadingInformation[1], FALSE)
                      || (bool)require_once $classLoadingInformation[0];
        }

I think it has something to do with the extensions BackendUtility class.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.