Commit d1d2b3c6 authored by Helmut Hummel's avatar Helmut Hummel
Browse files

[BUGFIX] Call extension installer only with extension packages

Calling the TYPO3 extension installer with a root package
of a different type will lead to an exception to be thrown.

Move the install path check after the type check, to be sure
to call the installer only with extension types.

Resolves: #96028
Related: #96021
Releases: master, 11.5
Change-Id: Icdebc1a541a0b43461559e8f7a4a999fb1b327f3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72229


Tested-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Tested-by: Helmut Hummel's avatarHelmut Hummel <typo3@helhum.io>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Helmut Hummel's avatarHelmut Hummel <typo3@helhum.io>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 1342dd32
......@@ -225,13 +225,15 @@ class PackageArtifactBuilder extends PackageManager implements InstallerScript
{
$baseDir = $this->config->get('base-dir');
$composer = $this->event->getComposer();
$typo3ExtensionInstallPath = $composer->getInstallationManager()->getInstaller('typo3-cms-extension')->getInstallPath($rootPackage);
if ($rootPackage->getType() !== 'typo3-cms-extension'
|| !file_exists($baseDir . '/Resources/Public/')
|| strpos($typo3ExtensionInstallPath, self::LEGACY_EXTENSION_INSTALL_PATH) === false
) {
return [$rootPackage, $baseDir, $extensionKey];
}
$typo3ExtensionInstallPath = $composer->getInstallationManager()->getInstaller('typo3-cms-extension')->getInstallPath($rootPackage);
if (strpos($typo3ExtensionInstallPath, self::LEGACY_EXTENSION_INSTALL_PATH) === false) {
return [$rootPackage, $baseDir, $extensionKey];
}
$filesystem = new Filesystem();
if (!file_exists($typo3ExtensionInstallPath) && !$filesystem->isSymlinkedDirectory($typo3ExtensionInstallPath)) {
$filesystem->ensureDirectoryExists(dirname($typo3ExtensionInstallPath));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment