Review 14.3 Merged

95234[BUGFIX] Implode nested placeholder arrays

Stefan Bürk CR +2 V +2 Normal +166 −2 updated 08/10/26, 23:28

Commit message

A TCA field can take its placeholder from a related record by naming the
path to it:

    'placeholder' => '__row|aRelation|aSelectField'

TcaInputPlaceholders follows that path, one hop per recursion level.
Where the last hop lands on a select, category or group field, the value
it finds there is an array of uids, because the FormDataProviders have
already resolved it. Such an array was joined into a string on the first
level only, while the return value was cast to a string on every level.

A path of two or more hops therefore ended in the literal word "Array",
which is what casting an array produces, and that word was shown to the
editor together with an "Array to string conversion" warning. An empty
relation ran into the same cast and also produced "Array", although
#70146 established that it should leave the placeholder empty.

The array is now joined on every level. A later hop yields the same
comma separated list the first hop always did, and an empty relation
drops the placeholder again. The removed condition was never a
safeguard: it replaced a todo note stating that a proper fix would have
to take the recursion into account.

The fixture of an existing test declared a column its placeholder path
never reads, so the test left through the early return for fields
without TCA instead of the traversal it covers. It now declares the
field the path names, as its two neighbours already did.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 2

Files 2

Review log 34

  1. Stefan Bürk commented on patch set 1 08/10/26, 22:46

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 08/10/26, 22:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106342

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 08/10/26, 23:28

  4. Stefan Bürk merged patch set 2 08/10/26, 23:28