Project

General

Profile

Bug #87545

Updated by Beat Haenger about 5 years ago

In typo3conf/ext/my_ext/Configuration/TCA/Overrides/sys_file_reference.php 

 <pre> 
 $GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config']['cropVariants'] = [ 
    'default' => [ 
       'title' => 'default', 
       'selectedRatio' => 'NaN', 
       'allowedAspectRatios' => [ 
          'NaN' => [ 
             'title' => 'Free', 
             'value' => 0.0 
          ] 
       ] 
    ], 
    'other' => [ 
       'title' => 'other', 
       'selectedRatio' => 'NaN', 
       'allowedAspectRatios' => [ 
          'NaN' => [ 
             'title' => 'Free', 
             'value' => 0.0 
          ] 
       ] 
    ] 
 ];  
 </pre> 
 In typo3conf/ext/my_ext/Configuration/TCA/Overrides/pages.php 
 <pre> 
 $GLOBALS['TCA']['pages']['columns']['media']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants'] = [ 
    'default' => [ 
       'title' => 'title for this field', 
       'selectedRatio' => '16:9', 
       'allowedAspectRatios' => [ 
          'NaN' => [ 
             'title' => 'Free', 
             'value' => 0.0 
          ], 
          '16:9' => [ 
             'title' => '16:9', 
             'value' => 1.7777777 
          ] 
       ] 
    ] 
 ]; 
 </pre> 

 Expected behaviour: The field "media" of "pages" has only one crop variant named "title for this field" with 2 aspect ratios "Free" and "16:9". 

 Actual behaviour: The field "media" of "pages" still has 2 crop variants ("title for this field" and "other") and the ascept ratios also get merged instead of overwritten ("default" has "NaN" and "16:9" while "other" has "NaN") 

 "overrideChildTca" thus in this case (and maybe others) only merges the arrays instead of replacing them. Merging is not what an option with "override" in the name should do. 

 This makes it impossible to have fewer crop variants and aspect ratios in a specific field than defined in the field of sys_file_reference. 

Back