Review 13.4 Merged

95235[BUGFIX] Implode nested placeholder arrays

Stefan Bürk CR +2 V +2 Normal +135 −3 updated 08/10/26, 23:29

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 fixtures of two existing tests declared a column their placeholder
path never reads, so those tests left through the early return for
fields without TCA instead of the traversal they cover. They now
declare the field the path names, as their 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 uploaded patch set 1 08/10/26, 23:14

  2. core-ci voted on patch set 1 V +1 08/10/26, 23:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106343

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

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