Skip to content

Commit

Permalink
[BUGFIX] Call extension installer only with extension packages
Browse files Browse the repository at this point in the history
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 <typo3@gilbertsoft.org>
Tested-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Simon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
helhum committed Nov 18, 2021
1 parent 1342dd3 commit d1d2b3c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions typo3/sysext/core/Classes/Composer/PackageArtifactBuilder.php
Expand Up @@ -225,13 +225,15 @@ private function handleRootPackage(PackageInterface $rootPackage, string $extens
{
$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));
Expand Down

0 comments on commit d1d2b3c

Please sign in to comment.