Project

General

Profile

Actions

Bug #87545

open

overrideChildTca does not work as expected for cropVariants (and maybe in other cases aswell)

Added by Beat Haenger over 5 years ago. Updated about 4 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2019-01-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

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

$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
         ]
      ]
   ]
]; 

In typo3conf/ext/my_ext/Configuration/TCA/Overrides/pages.php
$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
         ]
      ]
   ]
];

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.

Actions

Also available in: Atom PDF