#110290Extension Manager fatals on outdated extension list records
Description
Problem
With #104515 (“Free table tx_extensionmanager_domain_model_extension from TCA”) the actions of EXT:extensionmanager which operate on a single remote (TER) extension record stopped receiving an Extbase mapped domain object. They now take an integer uid and resolve the record themselves:
bc. – public function checkDependenciesAction(Extension $extension): ResponseInterface
+ public function checkDependenciesAction(int $extension): ResponseInterface
{
+ $extension = $this->extensionRepository->findByUid($extension);
“ExtensionRepository::findByUid()” is declared as “?Extension”, but none of the call sites handles the null case:
- “DownloadController::checkDependenciesAction()”
- “DownloadController::installFromTerAction()”
- “DownloadController::checkDistributionDependenciesAction()”
- “DownloadController::installDistributionAction()”
- “DistributionController::showAction()”
A missing record therefore ends in either a TypeError (null passed to a method typed against “Extension”) or “Attempt to read property … on null”. Both are “\Error”, which is not covered by the surrounding “catch (\Exception)” blocks, so the request dies with a fatal error instead of reporting a problem.
Why this is reachable
“BulkExtensionRepositoryWriter::import()” deletes all rows of a remote and bulk-inserts the parsed extension list again. Every “Update extension list from TER” therefore reassigns all uids of “tx_extensionmanager_domain_model_extension”. Any Extension Manager view rendered before such an update carries uids which no longer exist.
How to reproduce
- Open the Extension Manager in classic (non composer) mode and switch to “Get Extensions”
- Update the extension list from TER a second time, e.g. from another browser tab or window
- Return to the first tab and press “Import and Install” (or open a distribution detail view)
Expected
A controlled and speaking error, telling that the record is not available anymore.
Actual
An uncaught PHP “\Error” / fatal error.
Before #104515 the actions were typed against “Extension” and Extbase property mapping turned an unresolvable uid into a regular mapping error instead of a fatal.
Affected branches
The removal landed in 14.0, 14.1, 14.3 and main. Maintained are main and 14.3.
Reviews 7
- 13.4 95053[BUGFIX] Isolate update check from download queue
- 14.3 95052[BUGFIX] Isolate update check from download queue
- main 94474[BUGFIX] Isolate update check from download queue
- main 94960[TASK] Identify remote packages by key, version and remote
- 14.3 95017[TASK] Identify remote packages by key, version and remote
- 14.3 94954[BUGFIX] Handle unknown extension list records
- main 94939[BUGFIX] Handle unknown extension list records