Feature: #97271 - New TCA type "color"

See forge#97271

Description

Especially TCA type input has a wide range of use cases, depending on the configured renderType and the eval options. Determination of the semantic meaning is therefore usually quite hard and often leads to duplicated checks and evaluations in custom extension code.

In our effort of introducing dedicated TCA types for all those use cases, the TCA type color has been introduced. It replaces the renderType=colorpicker of TCA type input.

The TCA type color features the following column configuration:

  • behaviour: allowLanguageSynchronization
  • default
  • fieldControl
  • fieldInformation
  • fieldWizard
  • mode
  • nullable
  • placeholder
  • readOnly
  • required
  • search
  • size
  • valuePicker: items

The following column configuration can be overwritten by page TSconfig:

  • readOnly
  • size

A complete migration from renderType=colorpicker to type=color looks like the following:

// Before

'a_color_field' => [
    'label' => 'Color field',
    'config' => [
        'type' => 'input',
        'renderType' => 'colorpicker',
        'required' => true,
        'size' => 20,
        'max' => 1024,
        'eval' => 'trim',
        'valuePicker' => [
            'items' => [
                ['typo3 orange', '#FF8700'],
            ],
        ],
    ],
],

// After

'a_color_field' => [
    'label' => 'Color field',
    'config' => [
        'type' => 'color',
        'required' => true,
        'size' => 20,
        'valuePicker' => [
            'items' => [
                ['typo3 orange', '#FF8700'],
            ],
        ],
    ]
]
Copied!

An automatic TCA migration is performed on the fly, migrating all occurrences to the new TCA type and triggering a PHP E_USER_DEPRECATED error where code adoption has to take place.

Impact

It's now possible to simplify the TCA configuration by using the new dedicated TCA type color.