I can override the cropVaraints for an image field in TCA like this:
'columnsOverrides' => [
'image' => [
'label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_be.xlf:general.field.image',
'config' => [
'overrideChildTca' => [
'columns' => [
'crop' => [
'config' => [
'cropVariants' => [
'default' => [
'title' => 'LLL:EXT:myext/Resources/Private/Language/locallang_be.xlf:wizard.banner.title',
'allowedAspectRatios' => [
'2:1' => [
'title' => 'LLL:EXT:myext/Resources/Private/Language/locallang_be.xlf:field.banner.image-crop.ratio',
'value' => 2 / 1
],
],
],
],
],
],
],
],
],
],
],
I tryed to adabt this to flexform - but without any success. So what I need is something like this (but working :-) )
<foreign_selector_fieldTcaOverride type="array">
<config>
<appearance>
<elementBrowserType>file</elementBrowserType>
<elementBrowserAllowed>jpg,png</elementBrowserAllowed>
</appearance>
<overrideChildTca>
<columns>
<crop>
<config>
<cropVariants>
<default>
<title>Blubber</title>
<allowedAspectRatios>
<test>
<title>2:1</title>
<value>2 / 1</value>
</test>
</allowedAspectRatios>
</default>
</cropVariants>
</config>
</crop>
</columns>
</overrideChildTca>
</config>
</foreign_selector_fieldTcaOverride>
Does anybody did that before?
If it is not possible, maybe I can get arround the flexform? I currently have a gridelement with an Image field.
[UPDATE] As @fnagel pointed out it should be possible with overriding the default, so I tried to put the following into my Overrides/sys_file_reference.php - but it has no effect - I could even not find that default definition in TCA-Inspector...
$GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config']['cropVariants']['default'] = [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:wizard.gallery.title',
'allowedAspectRatios' => [
'NaN' => [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:field.gallery.image-crop.ratio',
'value' => 0.0
],
],
];
writing ot as has also no effect...
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
$GLOBALS['TCA']['sys_file_reference'],
[
'columns' =>[
'crop' => [
'config' => [
'cropVariants' => [
'default'=> [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:wizard.gallery.title',
'allowedAspectRatios' => [
'NaN' => [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:field.gallery.image-crop.ratio',
'value' => 0.0
],
],
],
],
],
],
],
]
);
Anybody with a successfull setup for that?