Issue Bug Closed

#94936ext_localconf.php is loaded twice when installing via the extension manager

Niels Jensen 08/19/21, 14:03 updated 10/14/21, 06:58

Description

When I install an extension manually via the extension manager in a non-composer installation, all ext_localconf.php files are reloaded in the method “reloadCaches” of the class TYPO3\CMS\Extensionmanager\Utility\InstallUtility. Since some extensions append entries to a global array here (e.g. $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = ... ) this leads to these entries being added twice (see screenshot).

Is this intentional?

This behavior recently caused a problem for me:
  • The extension “yoast_news” registers its own class this way: $GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['classes']['Domain/Model/News'][] = 'yoast_news';
  • The extension “news” generates a merged cache file from these entries
  • Since the same class was registered twice (caused by the above behavior) the class was also written twice to the cache file resulting in a fatal error “cannot redeclare …”.

However, this problem only occurs in a very special scenario in combination of the extension “flux”, which was used to register custom content elements in whose template files certain ViewHelpers were called (e.g. <f:form>...</f:form> ).

Therefore my question: Is it the task of the extension developers to make sure that identical entries in the global arrays are not processed multiple times, or should I as a developer be able to assume that the ext_localconf.php is loaded only once?

Reviews 0

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