Skip to content
Snippets Groups Projects
Commit 5e3b9dc4 authored by Thomas Maroschik's avatar Thomas Maroschik Committed by Anja Leichsenring
Browse files

[BUGFIX] Framework Packages aren't sorted properly

In the package dependency resolver, the method
buildDependencyGraph builds the dependency graph
first for the framework packages and afterwards
for all left packages.

The filtering if a package is a framework package
happens by comparing the package path with PATH_typo3
and a sysext folder contant. But as PATH_typo3 is
absolute and the package path from the package states
configuration is relative to PATH_site, this filter
does not work.

The patch changes the path to a relativ one.

Fixes: #55623
Releases: 6.2
Change-Id: I2f57dee433054463ebfd17aab5f76b19986c2747
Reviewed-on: https://review.typo3.org/27300
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Froemken
Tested-by: Stefan Froemken
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
parent de4811fc
Branches
Tags
No related merge requests found
......@@ -36,7 +36,7 @@ class DependencyResolver {
/**
* Folder with framework extensions
*/
const SYSEXT_FOLDER = 'sysext';
const SYSEXT_FOLDER = 'typo3/sysext';
/**
* @param array $packageStatesConfiguration
......@@ -171,8 +171,8 @@ class DependencyResolver {
$rootPackageKeys[] = $packageKey;
}
}
$extensionPackageKeys = $this->getPackageKeysInBasePath($packageStateConfiguration, '', array(PATH_typo3 . self::SYSEXT_FOLDER));
$frameworkPackageKeys = $this->getPackageKeysInBasePath($packageStateConfiguration, PATH_typo3 . self::SYSEXT_FOLDER);
$extensionPackageKeys = $this->getPackageKeysInBasePath($packageStateConfiguration, '', array(self::SYSEXT_FOLDER));
$frameworkPackageKeys = $this->getPackageKeysInBasePath($packageStateConfiguration, self::SYSEXT_FOLDER);
foreach ($extensionPackageKeys as $packageKey) {
// Remove framework packages from list
$packageKeysWithoutFramework = array_diff(
......@@ -198,7 +198,7 @@ class DependencyResolver {
* @return array
*/
protected function buildDependencyGraph(array $packageStateConfiguration) {
$frameworkPackageKeys = $this->getPackageKeysInBasePath($packageStateConfiguration, PATH_typo3 . self::SYSEXT_FOLDER);
$frameworkPackageKeys = $this->getPackageKeysInBasePath($packageStateConfiguration, self::SYSEXT_FOLDER);
$dependencyGraph = $this->buildDependencyGraphForPackages($packageStateConfiguration, $frameworkPackageKeys);
$packageStateConfiguration = $this->addDependencyToFrameworkToAllExtensions($packageStateConfiguration, $dependencyGraph);
......
......@@ -44,8 +44,8 @@ class DependencyResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$packageKeys = array_keys($unsortedPackageStatesConfiguration);
$basePathAssignment = array(
array($unsortedPackageStatesConfiguration, '', array(PATH_typo3 . DependencyResolver::SYSEXT_FOLDER), array_diff($packageKeys, $frameworkPackageKeys)),
array($unsortedPackageStatesConfiguration, PATH_typo3 . DependencyResolver::SYSEXT_FOLDER, array(), $frameworkPackageKeys),
array($unsortedPackageStatesConfiguration, '', array(DependencyResolver::SYSEXT_FOLDER), array_diff($packageKeys, $frameworkPackageKeys)),
array($unsortedPackageStatesConfiguration, DependencyResolver::SYSEXT_FOLDER, array(), $frameworkPackageKeys),
);
$dependencyResolver = $this->getAccessibleMock('\TYPO3\CMS\Core\Package\DependencyResolver', array('getPackageKeysInBasePath'));
......@@ -63,8 +63,8 @@ class DependencyResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$packageKeys = array_keys($unsortedPackageStatesConfiguration);
$basePathAssignment = array(
array($unsortedPackageStatesConfiguration, '', array(PATH_typo3 . DependencyResolver::SYSEXT_FOLDER), array_diff($packageKeys, $frameworkPackageKeys)),
array($unsortedPackageStatesConfiguration, PATH_typo3 . DependencyResolver::SYSEXT_FOLDER, array(), $frameworkPackageKeys),
array($unsortedPackageStatesConfiguration, '', array(DependencyResolver::SYSEXT_FOLDER), array_diff($packageKeys, $frameworkPackageKeys)),
array($unsortedPackageStatesConfiguration, DependencyResolver::SYSEXT_FOLDER, array(), $frameworkPackageKeys),
);
$dependencyResolver = $this->getAccessibleMock('\TYPO3\CMS\Core\Package\DependencyResolver', array('getPackageKeysInBasePath'));
......@@ -104,8 +104,8 @@ class DependencyResolverTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$packageKeys = array_keys($unsortedPackageStatesConfiguration);
$basePathAssignment = array(
array($unsortedPackageStatesConfiguration, '', array(PATH_typo3 . DependencyResolver::SYSEXT_FOLDER), $packageKeys),
array($unsortedPackageStatesConfiguration, PATH_typo3 . DependencyResolver::SYSEXT_FOLDER, array(), array()),
array($unsortedPackageStatesConfiguration, '', array(DependencyResolver::SYSEXT_FOLDER), $packageKeys),
array($unsortedPackageStatesConfiguration, DependencyResolver::SYSEXT_FOLDER, array(), array()),
);
$dependencyResolver = $this->getAccessibleMock('\TYPO3\CMS\Core\Package\DependencyResolver', array('getActivePackageKeysOfType'));
......
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