[BUGFIX] Register FAL drivers with same short label once 71/44471/2
authorOliver Eglseder <oliver.eglseder@in2code.de>
Sun, 1 Nov 2015 15:29:10 +0000 (16:29 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 1 Nov 2015 18:55:39 +0000 (19:55 +0100)
When calling addDriversToTCA twice (it's called once in the core)
any previously added driver will get added another time.

This path makes shortName the index of the registered drivers.

Resolves: #71237
Releases: master
Change-Id: Ia0449212bf0e272c4959ecabab8171b5f922b7a2
Reviewed-on: https://review.typo3.org/44471
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php

index adbe0d7..6679b50 100644 (file)
@@ -95,7 +95,7 @@ class DriverRegistry implements \TYPO3\CMS\Core\SingletonInterface
         $configurationFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['configuration']['config'];
         foreach ($this->driverConfigurations as $driver) {
             $label = $driver['label'] ?: $driver['class'];
-            $driverFieldConfig['items'][] = array($label, $driver['shortName']);
+            $driverFieldConfig['items'][$driver['shortName']] = array($label, $driver['shortName']);
             if ($driver['flexFormDS']) {
                 $configurationFieldConfig['ds'][$driver['shortName']] = $driver['flexFormDS'];
             }