#90635Error is thrown when using EXT:extension_name for which is installed in different folder name in typo3conf/ext
Description
Problem
Given
- an extension e.g. yoast_seo copied to typo3conf/ext/yoast_typo3 (folder different than extension key)
- this extension has TYPOScript which references some file using EXT:yoast_seo syntax
Result:
- Backend is broken with “Call to a member function getPackagePath() on null” in ExtensionManagerUtility
Expected:
- either the file inclusion is ignored, or the path is correctly resolved (as TYPO3 can correctly translate yoast_seo to yoast_typo3 with$this->getPackageKeyFromComposerName($packageKey);
- breaking whole system is not expected
Technical details:
in this setup
- PackageManager->isPackageActive(‘yoast_seo’) return TRUE
- PackageManager->getPackageKeyFromComposerName(‘yoast_seo’) returns ‘yoast_typo3’
- PackageManager->isPackageRegistered(‘yoast_seo’) returns TRUE
- PackageManager->isPackageAvailable(‘yoast_seo’)returns TRUE
- ExtensionManagementUtility::isLoaded(‘yoast_seo’) returns TRUE
- ExtensionManagementUtility::extPath(‘yoast_seo’) throws “Call to a member function getPackagePath() on null“
- because PackageManager->getPackage(‘yoast_seo’) returns null
Seems like the API is inconsistent here.
Possible solution:
change
public function getPackage($packageKey)
{
if (!$this->isPackageRegistered($packageKey) && !$this->isPackageAvailable($packageKey)) {
throw new Exception\UnknownPackageException('Package "' . $packageKey . '" is not available. Please check if the package exists and that the package key is correct (package keys are case sensitive).', 1166546734);
}
return $this->packages[$packageKey];
}
to:
public function getPackage($packageKey)
{
if (!$this->isPackageRegistered($packageKey) && !$this->isPackageAvailable($packageKey)) {
throw new Exception\UnknownPackageException('Package "' . $packageKey . '" is not available. Please check if the package exists and that the package key is correct (package keys are case sensitive).', 1166546734);
}
return $this->packages[$this->getPackageKeyFromComposerName($packageKey)];
}Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.