Project

General

Profile

Actions

Bug #90635

open

Error is thrown when using EXT:extension_name for which is installed in different folder name in typo3conf/ext

Added by Tymoteusz Motylewski about 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
Should have
Category:
-
Target version:
-
Start date:
2020-03-04
Due date:
% Done:

0%

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

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)];
    }

Actions

Also available in: Atom PDF