#65797TCA: Allow context-based filtering by File Storage in FAL IRRE relations
Description
Currently, when configuring the TCA for a FAL relation, you can specify which file types are allowed and available in the element browser when selecting the file. It would be awesome to be able to also scope a particular TCA context to a subset of all available FAL storages.
FYI: References below are from TYPO3 6.2.11 release
For example, in the helper method
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig
we currently have parameters for
$allowedFileExtensionsWould it be possible to add something like these?:
$allowedFileStoragesand
$disallowedFileStorages
I spent a little time on this, and it appears filtering on the DataHandler / saving side can be relatively straightforward, by adding a new filtering class in $config[‘filter’].
The trickier part is dealing with the element browser. The configuration interface available in $config[‘foreign_selector_fieldTcaOverride’] (typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php:508) appears designed to support filtering only by the single facet (‘elementBrowserAllowed’ => [list of file extensions]). The config interface problem can be worked around, perhaps, but I ran into really mucky territory when looking at ways to leverage the filtering information to limit tree scope when rendering the element browser in TYPO3\CMS\Recordlist\Browser\ElementBrowser::main_file (sysext/recordlist/Classes/Browser/ElementBrowser.php:1376).
Anyone have any ideas? This would be a great feature, and it seems unusual that it’s not in place already.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[FEATURE] TCA: Allow context-based filtering by File Storage in FAL IRRE relations Resolves: #65797 Releases: main