Bug #64617
Don' change configuration of filestorage if files are present
Status: | Accepted | Start date: | 2015-01-29 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | File Abstraction Layer (FAL) | Spent time: | - | |
Target version: | 7.4 (Backend) | |||
TYPO3 Version: | 6.2 | Is Regression: | No | |
PHP Version: | Sprint Focus: | Remote Sprint | ||
Complexity: | medium |
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.
Related issues
History
#1 Updated by Ingo Schmitt 6 months ago
- Complexity set to medium
Idea could be to create a user function to render the field depending on the files inside the storage
#2 Updated by Frans Saris 6 months ago
- Status changed from New to In Progress
#3 Updated by Philipp Thiele 6 months 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>
#4 Updated by Mathias Schreiber 6 months ago
- Status changed from In Progress to Accepted
#5 Updated by Benjamin Mack about 1 month ago
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
#6 Updated by Susanne Moog 17 days ago
- Sprint Focus changed from On Location Sprint to Remote Sprint