Review main Abandoned

90155[BUGFIX] Properly handle tables with `label_alt` only

Oli Bartsch CR 0 V -1 Normal +143 −9 updated 10/05/26, 13:21

Commit message

Previously, TCA tables required a `label` definition
in `['ctrl']` even when only `label_alt` was used. This
created unnecessary configuration overhead and also
does not align with the documentation[1], which
defines for `label_alt`:

> Comma-separated list of field names, which are holding
> alternative values to the value from the field pointed
> to by "label" (see above) **if that value is empty**.

The LabelCapability already respects this by allowing
`$primaryFieldName` to be NULL. However, `hasCapability()`
checked for `label` only and therefore "failed" to support
`label_alt` properly.

Changes:

* TcaRecordTitle now allows processing when only 'label_alt'
  is defined
* TcaSchema `hasCapability(TcaSchemaCapability::Label)` now
  return `TRUE` if either `label` or `label_alt` is set.
* Added tests for the new behavior

Review

  • Code review CR 0
  • Verified V -1
    • core-ci -1 CI

Issues 1

Files 3

Review log 1720

  1. Oli Bartsch uploaded patch set 1 07/25/25, 08:55

  2. core-ci voted on patch set 1 V +1 07/25/25, 09:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/82311

  3. Benni Mack voted on patch set 1 CR +1 07/25/25, 09:07

  4. Benni Mack voted on patch set 1 V +1 07/25/25, 09:47

  5. Nikita Hovratov commented on patch set 1 CR +1 V +1 07/25/25, 19:44

    I think this is a good patch and will make some code in Content Blocks easier as well. Not sure if this qualifies as bugfix, though. More like a quality of life change? Naming wise it makes sense that an alternative label must replace something else (the main label). Anyway, having 3 different options for the label is very confusing for users. This is why in Content Blocks there is only 1 option for this, which can either be one label field, or a list of label fields.
  6. Nikita Hovratov commented on patch set 1 V 0 07/25/25, 19:48

    Maybe one more thing: Are we sure that label_alt is used consistently in TYPO3? The documentation states: > May not be used consistently in the system, but should apply in most cases.
  7. Oli Bartsch commented on patch set 1 07/25/25, 20:51

    Reply

    I'm quite sure as we are using Schema API everywhere except FormEngine, which will be done until LTS in any case.
  8. Oli Bartsch commented on patch set 1 07/25/25, 20:57

    Reply

    Checked this again. There are only three places, directly accessing label_alt. The two RecordTitle form data provider and the BackendUtility::getRecordTitle(). All those places are working. Actually this patch just ensures, that label_alt is respected in even if "label" is not set. That means: It's an addition, so it's also safe to backport.
  9. Oli Bartsch commented on patch set 1 07/25/25, 21:01

    Reply

    In v13 there is only one additional place in DatabaseRecordList where Schema API migration was not backported. However this is about adding those fields to a "fields list" - so has nothing to do with this patch.
  10. Nikita Hovratov commented on patch set 1 CR 0 V -1 07/26/25, 21:11

    Reply

    Thanks for looking deeper into this. Right now I still see problems, as there is no "main label field" anymore. For example no label would be rendered in the List view, if only label_alt is defined. We could use the first field in label_alt as the main label as workaround. All in all, I think we should just rework the label handling completely, instead of tinkering with its clunky behavior. This behavior is so old, even if we improve it, it makes it even more confusing, as it wouldn't be a required option anymore like it always has been. Without an RST no one will ever know something changed there.
  11. Anja Leichsenring commented on patch set 1 CR -1 08/12/25, 19:03

    Reply

    While I would not agree with the requirement to overwork title behaviour before fixing bugs (sorry Nikita), I rather question the sensibility of this change. The documentation cited (use first field of label_alt _with a value_ if label field _value_ is empty) talkes about database row field values, not the configuration itself. Avoiding the configuration of the label field, while still providing label_alt makes no sense syntactically and will probably cause more harm that benefit. Please do not remove the requirement for the label field being configured. Reworking the title generation handling might be a good idea nonetheless, but I guess it's not the time right now.
  12. Oli Bartsch commented on patch set 1 08/12/25, 19:27

    Reply

  13. Anja Leichsenring commented on patch set 1 08/12/25, 19:42

    Reply

    Can't see how? By extending the condition for the exception to be thrown, you allow for no label field configuration. Ensuring that on type level feels clumsy and error prone. Do I misunderstand something here?
  14. Oli Bartsch commented on patch set 1 08/12/25, 21:09

    Reply Unresolved

    Not sure about every detail yet. We however will, as already suggested by Nikita, rework the handling altogether.
  15. Benni Mack wrote 04/21/26, 15:00

    Removed reviewer Benni Mack with the following votes: * Code-Review+1 by Benni Mack * Verified+1 by Benni Mack
  16. Benni Mack updated the commit message in patch set 2 CR -1 V +1 04/22/26, 06:52

  17. core-ci voted on patch set 2 V -1 04/22/26, 11:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100821

  18. Benni Mack rebased onto patch set 3 V -1 10/02/26, 07:01

  19. core-ci voted on patch set 3 V -1 10/02/26, 07:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/109875

  20. Oli Bartsch abandoned the change 10/05/26, 13:21

    Will be reworked differently.