Actions
Bug #95305
closedExtensionManagementUtility::isLoaded() cannot be used in Configuration/Services.php
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
Start date:
2021-09-21
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
When using the following code in Configuration/Services.php to check if an extension is loaded:
return function (ContainerConfigurator $configurator): void { if (!ExtensionManagementUtility::isLoaded('dashboard')) { return; } // ... register widgets }
the following exception is thrown:
Call to a member function isPackageActive() on null in /var/www/html/public/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php line 120
This is since TYPO3 11.4, in 11.3 it worked.
Updated by Oliver Hader about 3 years ago
- Category set to System/Bootstrap/Configuration
Updated by Chris Müller about 3 years ago
Maybe related when importing a site configuration from an extension:
Example:
config/sites/main/config.yaml
imports: - { resource: 'EXT:myext/Configuration/Sites/config.yaml' }
throws the same exception:
Call to a member function isPackageActive() on null in /var/www/html/public/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php line 120 at TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('myext') in /var/www/html/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2816 at TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('') in /var/www/html/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php line 125 at TYPO3\CMS\Core\Configuration\Loader\YamlFileLoader->getStreamlinedFileName('EXT:myext/Configuration/Sites/config.yaml', '/var/www/html/config/sites/main/config.yaml') in /var/www/html/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php line 81
Updated by Chris Müller about 3 years ago
- Is duplicate of Bug #95327: Push PackageManager to ExtensionManagementUtility in bootstrap added
Updated by Oliver Bartsch about 3 years ago
- Status changed from New to Resolved
Applied in changeset 11c7e844ed6386d23a6e9c897cc9704c81ef7f80.
Updated by Georg Ringer about 3 years ago
- Has duplicate Bug #95401: Site configuration imports broken in v11.4 added
Actions