[BUGFIX] Settings for local drivers are not shown by default 12/19212/2
authorNicole Cordes <typo3@cordes.co>
Fri, 22 Mar 2013 15:11:35 +0000 (16:11 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Wed, 27 Mar 2013 06:48:48 +0000 (07:48 +0100)
If you create a new storage the LocalDriver is selected by default
(because it is the first registered driver) but the flexform field is not
shown. Because of the hidden configuration field you cannot set up the
base path until you have saved the storage record. Local driver should be
selected by default and configuration field should be displayed every
time.

Change-Id: Ic9c6c1eb7ca3d9f45723dce728558002440ae9da
Fixes: #46555
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/19212
Reviewed-by: Alexander Opitz
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
t3lib/stddb/tca_sys_file_storage.php
typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php

index ddbbb8b..714cd1b 100644 (file)
@@ -85,7 +85,8 @@ $TCA['sys_file_storage'] = array(
                        'config' => array(
                                'type' => 'select',
                                'items' => array(),
-                               'default' => ''
+                               'default' => 'Local',
+                               'onChange' => 'reload'
                        )
                ),
                'configuration' => array(
@@ -96,7 +97,6 @@ $TCA['sys_file_storage'] = array(
                                'ds_pointerField' => 'driver',
                                'ds' => array()
                        ),
-                       'displayCond' => 'REC:NEW:false'
                )
        ),
        'types' => array(
index 25de4a4..fdba5d5 100644 (file)
@@ -97,13 +97,13 @@ class DriverRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                if (TYPO3_MODE !== 'BE') {
                        return;
                }
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_file_storage');
+               $driverFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['driver']['config'];
+               $configurationFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['configuration']['config'];
                foreach ($this->driverConfigurations as $driver) {
                        $label = $driver['label'] ?: $driver['class'];
-                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_file_storage');
-                       $driverFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['driver']['config'];
                        $driverFieldConfig['items'][] = array($label, $driver['shortName']);
                        if ($driver['flexFormDS']) {
-                               $configurationFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['configuration']['config'];
                                $configurationFieldConfig['ds'][$driver['shortName']] = $driver['flexFormDS'];
                        }
                }