Project

General

Profile

Actions

Bug #54581

closed

Epic #47018: Implement Composer support and clean package manager API

Please repair PackageStates before next Beta!

Added by Stefan Froemken almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
Start date:
2013-12-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

Hello Core-Team,

I know...current git state of TYPO3 is beta, but there are some basic functions in TYPO3 which still needs some love. I already have created an ticket regarding dependencies in PackageStates.php. Now I have found a second bug:

Here a simplified visualisation of: $this->packageStatesConfiguration['packages']:

array(
    'about' => array(...),
    'backend' => array(...),
    'core' => array(...),
    'yellowpages' => array(...), <--This extension has a dependency to jw_categories
    'files' => array(...), <-- I have deleted this extension in extManager
    'tt_news' => array(...),
    'jw_categories' => array(...),
)

If I delete "files" you call:

protected function unregisterPackageByPackageKey($packageKey) {
    unset($this->packages[$packageKey]);
    unset($this->packageKeys[strtolower($packageKey)]);
    unset($this->packageStatesConfiguration['packages'][$packageKey]);
    $this->sortAndSavePackageStates();
}

In this function you remove files correctly, but you call $this->sortAndSavePackageStates() and this a mistake. $this->sortAndSavePackageStates() only works with already registered packages. So our packages array looks like:

array(
    'about' => array(...),
    'backend' => array(...),
    'core' => array(...),
    'yellowpages' => array(...), <--This extension has a dependency to jw_categories
);

$this->sortAndSavePackageStates() cannot find package jw_categories, because it is not registered already. Backtrace:

PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'The package "yellowpages2" depends on "jw_categories" which is not present in the system.' in /Applications/MAMP/htdocs/typo3_src/typo3/sysext/core/Classes/Package/PackageManager.php:636
Stack trace:
#0 /Applications/MAMP/htdocs/typo3_src/typo3/sysext/core/Classes/Package/PackageManager.php(692): TYPO3\CMS\Core\Package\PackageManager->buildDependencyGraphForPackages(Array)
#1 /Applications/MAMP/htdocs/typo3_src/typo3/sysext/core/Classes/Package/PackageManager.php(719): TYPO3\CMS\Core\Package\PackageManager->buildDependencyGraph()
#2 /Applications/MAMP/htdocs/typo3_src/typo3/sysext/core/Classes/Package/PackageManager.php(776): TYPO3\CMS\Core\Package\PackageManager->getAvailablePackageLoadingOrder()
#3 /Applications/MAMP/htdocs/typo3_src/typo3/sysext/core/Resources/PHP/TYPO3.Flow/Classes/TYPO3/Flow/Package/PackageManager.php(914): TYPO3\CMS\Core\Package\PackageManager->sortAvailablePackagesByDependencies()
#4 /Applications/MAMP/htdocs/typo3_src/typo3/s in /Applications/MAMP/htdocs/typo3_src/typo3/sysext/core/Classes/Package/PackageManager.php on line 636

Stefan


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #54142: Dependencies for non-composerbased extensions not regarded for ordering PackageStatesClosedThomas Maroschik2013-12-02

Actions
Related to TYPO3 Core - Task #55404: Extract package dependency sorting to own classClosedThomas Maroschik2014-01-28

Actions
Actions #1

Updated by Markus Klein almost 11 years ago

How did the jw_categories ext get into the $this->packageStatesConfiguration['packages'] if it was not registered before?
Where did tt_news go??

Actions #2

Updated by Thomas Maroschik almost 11 years ago

Potentially we should just consider active packages in the dependency solving algorithm. All inactive packages are basically irrelevant.

Actions #3

Updated by Stefan Froemken almost 11 years ago

I'm sorry about this ticket here.I have tried to solve this problem on myself, but if I change a little bit here it crashes somewhere else. This bug here only appears, if you delete the Flow-Check for TYPO3-Extensions. I'm sure Thomas knows what I mean, because we have discussed about it some weeks ago on skype.

@Markus: As far as I can see, all extensions from ext-paths will be added to $this->packageStatesConfiguration['packages']. Later on while registration process some packages will be removed from this array again.

In my kind of view this is a very important bug which has to be solved. As long as sorting does not work correctly incl. dependencies, extensions cannot override TCA configuration of other extensions. Sure, maybe it works, but this is because of different orderings with each additionally installed extension.

Stefan

Actions #4

Updated by Gerrit Code Review almost 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27002

Actions #5

Updated by Ernesto Baschny almost 11 years ago

  • Parent task set to #47018
Actions #6

Updated by Thomas Maroschik almost 11 years ago

  • Status changed from Under Review to Closed
  • % Done changed from 0 to 100

The issue has been solved by #55404.

Actions #7

Updated by Thomas Maroschik almost 11 years ago

  • Assignee set to Thomas Maroschik
Actions

Also available in: Atom PDF