Project

General

Profile

Actions

Bug #93249

closed

TYPO3 FAL Driver Registry is unclear

Added by Justus Moroni over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2021-01-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Today I encountered an issue with FAL drivers as I was testing the implementation of a 3rd Party FAL driver (https://github.com/nextmotion/google-cloud-storage-fal/)

I wanted to clear the `_processed_` files from the storage, that used the FAL driver for the google cloud storage, via the Install Tool "Maintenance -> Remove Temporary Assets".
The processed files of the storage were not listed in the statistics and could not be cleared.


My debugging results

When I check the DriverRegistry in line `public/typo3/sysext/core/Classes/Resource/StorageRepository.php:187` the only driver listed is the `Local` one.

The google cloud storage driver is not listed in `$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers']` because it was registered with the following code in the `ext_localconf.php`:

$driverRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\Driver\DriverRegistry::class);
$driverRegistry->registerDriverClass(...);

instead of setting the configuration of the driver in the `$GLOBALS` array directly:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['fal']['registeredDrivers']['Foo'] = [
    'class' => \Foo\Bar\Driver\StorageDriver::class,
    'flexFormDS' => 'FILE:EXT:bar/Configuration/FlexForms/Storage.xml',
    'label' => 'Foo Bar',
    'shortName' => \Foo\Bar\Driver\StorageDriver::class,
];

The singleton of `\TYPO3\CMS\Core\Resource\Driver\DriverRegistry` in the Install Tool does not contain the driver that was added via `->registerDriverClass(...)` because it uses the `\TYPO3\CMS\Core\DependencyInjection\FailsafeContainer` instead of the normal Dependency Injection container.


This can be reproduced if you install any TYPO3 FAL driver other than the `Local` driver like and try to clear processed files via the Install Tool:
https://github.com/nextmotion/google-cloud-storage-fal/


My problem is that I could not find the correct way in which FAL drivers should be registered in the documentation.
So I'm not entirely sure if this is actually an issue with the TYPO3 Core.

Is there a correct way for the registration of a new driver?
Does the API in `\TYPO3\CMS\Core\Resource\Driver\DriverRegistry` to register the drivers need to be changed?

Actions #1

Updated by Gerrit Code Review over 3 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/c/Packages/TYPO3.CMS/+/67444

Actions #2

Updated by Gerrit Code Review over 2 years ago

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

Actions #3

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67444

Actions #4

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67444

Actions #5

Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67444

Actions #6

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67444

Actions #7

Updated by Gerrit Code Review over 2 years ago

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

Actions #8

Updated by Anonymous over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF