Project

General

Profile

Actions

Bug #66838

closed

ExtensionManager loads ext_autoload.php to late

Added by Robert Vock almost 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2015-05-07
Due date:
% Done:

0%

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

Description

When installing an extension, which depends on an extension with ext_autoload.php, the class-information in that file is not available soon enough.

I have an extension, which depends on realurl and also tries to import data with a data.t3d file in the Initialisation-folder.

Realurl registers a hook for process_datamap:
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']['tx_realurl'] = 'EXT:realurl/class.tx_realurl_tcemain.php:&tx_realurl_tcemain';

The constructor of this class relies on autoloading the tx_realurl_apiwrapper, which results in the following Error

Fatal error: Class 'tx_realurl_apiwrapper' not found in /typo3/typo3conf/ext/realurl/class.tx_realurl_tcemain.php on line 49
Call Stack
#    Function Location
1    main}( )    ../mod.php:0
2    TYPO3\CMS\Extbase\Core\ModuleRunner->callModule( )    ../mod.php:38
3    TYPO3\CMS\Extbase\Core\Bootstrap->run( )    ../ModuleRunner.php:67
4    TYPO3\CMS\Extbase\Core\Bootstrap->handleRequest( )    ../Bootstrap.php:184
5    TYPO3\CMS\Extbase\Mvc\Web\BackendRequestHandler->handleRequest( )    ../Bootstrap.php:195
6    TYPO3\CMS\Extbase\Mvc\Dispatcher->dispatch( )    ../BackendRequestHandler.php:33
7    TYPO3\CMS\Extbase\Mvc\Controller\ActionController->processRequest( )    ../Dispatcher.php:69
8    TYPO3\CMS\Extbase\Mvc\Controller\ActionController->callActionMethod( )    ../ActionController.php:157
9    call_user_func_array:{/typo3/typo3_src/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php:286} ( )    ../ActionController.php:286
10    TYPO3\CMS\Extensionmanager\Controller\ActionController->toggleExtensionInstallationStateAction( )    ../ActionController.php:286
11    TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService->installExtension( )    ../ActionController.php:64
12    TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService->installDependencies( )    ../ExtensionManagementService.php:158
13    TYPO3\CMS\Extensionmanager\Utility\InstallUtility->install( )    ../ExtensionManagementService.php:254
14    TYPO3\CMS\Extensionmanager\Utility\InstallUtility->processDatabaseUpdates( )    ../InstallUtility.php:113
15    TYPO3\CMS\Extensionmanager\Utility\InstallUtility->importT3DFile( )    ../InstallUtility.php:235
16    TYPO3\CMS\Impexp\Utility\ImportExportUtility->importT3DFile( )    ../InstallUtility.php:472
17    TYPO3\CMS\Impexp\ImportExport->importData( )    ../ImportExportUtility.php:52
18    TYPO3\CMS\Impexp\ImportExport->writeRecords_pages( )    ../ImportExport.php:1445
19    TYPO3\CMS\Core\DataHandling\DataHandler->process_datamap( )    ../ImportExport.php:1802
20    TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj( )    ../DataHandler.php:929
21    TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( )    ../GeneralUtility.php:4366
22    TYPO3\CMS\Core\Utility\GeneralUtility::instantiateClass( )    ../GeneralUtility.php:4414
23    tx_realurl_tcemain->__construct( )    ../GeneralUtility.php:4432

Realurl has an ext_autoload.php, but the data within the file is not available until AFTER the installation process has completly finished.

This error also appeared, after set both extensions to clearCacheOnLoad.

The bug might be related to #65785


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #65141: Fatal Error: 'tx_div2007_core' not foundClosed2015-02-18

Actions
Related to TYPO3 Core - Bug #66696: classAliasMap missing after extension installationClosedNicole Cordes2015-04-30

Actions
Actions #1

Updated by Robert Vock almost 9 years ago

Changing the method TYPO3\CMS\Core\Core\ClassLoader::addActivePackage fixed the problem for me:

$classNameToAliasMapping = $this->classAliasMap->setPackages($this->packages)->buildMappingAndInitializeEarlyInstanceMapping();
$this->loadClassFilesFromAutoloadRegistryIntoRuntimeClassInformationCache($this->packages);
$this->classAliasMap->buildMappingFiles($classNameToAliasMapping);
$this->transferRuntimeClassInformationCacheEntriesToClassesCache();

(Before it was only the second line)

But I am not sure, if this the correct fix or does too much work...

Actions #2

Updated by Mathias Schreiber almost 9 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Mathias Schreiber

Hi Robert,

can you please test this with the current master and/or current 6.2 branch?
We think we fixed this one last weekend.

Thanks in advance

Actions #3

Updated by Helmut Hummel almost 9 years ago

This change (already merged in current 6.2 branch): https://review.typo3.org/#/c/39217/4/typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php should fix your problem.

Can you please verify that? Thanks!

Actions #4

Updated by Robert Vock almost 9 years ago

The current 6.2 branch works. You can close this report.

Sorry for the duplicate. I had the wrong keywords when I searched for an existing bug ;)

Actions #5

Updated by Mathias Schreiber almost 9 years ago

  • Status changed from Needs Feedback to Resolved
Actions #6

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF