Project

General

Profile

Actions

Bug #95305

closed

ExtensionManagementUtility::isLoaded() cannot be used in Configuration/Services.php

Added by Chris Müller about 3 years ago. Updated about 3 years ago.

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.


Related issues 2 (0 open2 closed)

Is duplicate of TYPO3 Core - Bug #95327: Push PackageManager to ExtensionManagementUtility in bootstrapClosed2021-09-23

Actions
Has duplicate TYPO3 Core - Bug #95401: Site configuration imports broken in v11.4Closed2021-09-29

Actions
Actions #1

Updated by Oliver Hader about 3 years ago

  • Category set to System/Bootstrap/Configuration
Actions #2

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
Actions #3

Updated by Chris Müller about 3 years ago

  • Is duplicate of Bug #95327: Push PackageManager to ExtensionManagementUtility in bootstrap added
Actions #4

Updated by Oliver Bartsch about 3 years ago

  • Status changed from New to Resolved
Actions #5

Updated by Georg Ringer about 3 years ago

  • Has duplicate Bug #95401: Site configuration imports broken in v11.4 added
Actions #6

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF