Issue Bug Closed

#105820Option "max" is used to determine db column length

Nikita Hovratov 12/13/24, 10:53 updated 10/28/26, 17:00

Description

The TCA option max was always used to validate the number of characters of a simple text field.
But now it is also used to determine the column length of the db field.
This is problematic, since the max option can also be used in columnsOverrides.
Scenario: A field is defined in base TCA with max “20” and another element uses columnsOverrides to set it to “40” this will not work, because the database field will not change in size.
A proper solution would be to add an additional option “dbLength”, like it was done for type select.
This way it would be possible to set a definite max value, restricted by db and an alternative max value (possibly smaller) with max.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 3

  1. Oliver Bartsch commented and changed status New Closed <span data-processor="relativetime" data-value="2026-10-26T08:20:18+00:00" > 10/26/26, 08:20 </span>

    Hey,

    I had a look at this on main. You’re right that the auto-created column for type=input takes its length from max: VARCHAR, or TEXT above 255. The schema is derived from the base columns config only. A table has exactly one physical column per field, so columnsOverrides can’t influence it.

    I don’t think we need an extra option for this, though. The auto-created definition is only a default. An explicit definition in ext_tables.sql always takes precedence, so whenever the derived length doesn’t fit, you can define the column with the length you need there. Alternatively, set the largest max you need in the base column config and lower it per type via columnsOverrides. Lowering is fine. Only raising it above the column length causes trouble.

    Since both ways already cover the scenario, I’ll close this issue. If you have a case that neither of them can solve, please let me know and we’ll reopen.

    Cheers, Oli

  2. Nikita Hovratov commented <span data-processor="relativetime" data-value="2026-10-28T17:00:41+00:00" > 10/28/26, 17:00 </span>

    Hey Oli, thanks for the answer. With traditional ways (ext_tables.sql, base TCA defined size, TCA overrides) you can circumvent this problem. But (of course) there is a real issue in Content Blocks, which doesn’t use any of this, but only columnsOverides. See also: https://github.com/FriendsOfTYPO3/content-blocks/issues/291

    In Content Blocks you don’t necessarily have a centrally defined DB/TCA column, and of course no ext_tables.sql. So to be able to override the max property per Content Element, it needs to be placed in columnsOverrides. But by doing this, we cannot control the db size any longer. So the only possible way would be to have two separate options “dbSize” (base TCA) and “max” (columnsOverrides).

    It can also be a new feature, as it is not a bug in a strict sense.