Task #64617
openDon' change configuration of filestorage if files are present
0%
Description
If a file storage contains files, these files are indexed by the configuration setting of the storage. If you change the configuration of the storage (e.g.Case sensitive filesystem) TYPO3 might end up in not finding the files.
Solution: Disable the change of configuration of a file storage, if files are present.
Updated by Ingo Schmitt about 9 years ago
- Complexity set to medium
Idea could be to create a user function to render the field depending on the files inside the storage
Updated by Philipp Thiele about 9 years ago
User Experience would be best if we provide a readonly checkbox, probably followed by another (passthrough) field that gives a short explanation about the reason why the checkbox is disabled (there are files in this storage, so you can't change configuration).
We basically have two possible solutions:
- we render the field by userFunc, basically like in \TYPO3\CMS\Core\Resource\Service\UserStorageCapabilityService
- we implement a new tca field config option, that allows to mark and render a field as disable depending of a userFunc
I personally prefer the second option, so that we implement the new tca field config option that is quite similar to displayCond, but instead of hiding the field it only renders it with disabled attribute.
Basically it's the same functionality like its implemented for fields with l10n_config defaultAsReadonly \TYPO3\CMS\Backend\Form\FormEngine (line 1156 ff) - set ['config']['readOnly'] = TRUE, but dependent on the result of a userFunc.
The name of the option has to be discussed, a possible solution could be to taken the config option readOnly and allow a path, class- and method-name in it, or to define a new config option like readOnlyUserCond. This method should return TRUE or FALSE.
TCA config options could look like this:
'case_sensitive' => array( 'exclude' => 0, 'label' => 'LLL:EXT:lang/locallang_mod_file_list.xlf:localDriverFlexform_caseSensitive', 'config' => array( 'type' => 'check', 'default' => 1, 'readOnly' => 'typo3/sysext/core/Classes/Resource/Service/UserStorageCapabilityService.php:TYPO3\CMS\Core\Resource\Service\UserStorageCapabilityService->hasFiles' ) ),
or in flexform config, as we need it like this for this specific issue:
<caseSensitive> <TCEforms> <label>LLL:EXT:lang/locallang_mod_file_list.xlf:localDriverFlexform_caseSensitive</label> <config> <type>check</type> <default>1</default> <readOnly>typo3/sysext/core/Classes/Resource/Service/UserStorageCapabilityService.php:TYPO3\CMS\Core\Resource\Service\UserStorageCapabilityService->hasFiles</readOnly> </config> </TCEforms> </caseSensitive>
Updated by Mathias Schreiber about 9 years ago
- Status changed from In Progress to Accepted
Updated by Benni Mack almost 9 years ago
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Updated by Susanne Moog almost 9 years ago
- Sprint Focus changed from On Location Sprint to Remote Sprint
Updated by Susanne Moog over 8 years ago
- Target version changed from 7.4 (Backend) to 7.5