Review 12.4 Merged

81776[BUGFIX] Fix PHP error in FormEditor property preparation

Benjamin Franzke CR +2 V +2 Easy +5 −1 updated 11/20/23, 22:01

Commit message

This change fixes the error

`array_key_exists(): Argument #1 ($key) must be a valid array offset
type`

This error occurs, for example, when a SaveToDatabase finisher is
configured to map a form field named "type":

  finishers:
    -
      identifier: SaveToDatabase
      options:
        -
          table: tx_mytable
          elements:
            type:
              mapOnDatabaseColumn: foo

The FormEditor invokes
transformMultiValuePropertiesForFormEditor($definition, 'type', $types)
with the intent to transform all structures that contain a
`type: {someDefinedType}` child-entry to a slightly different format.
It does this recursively for the entire form configuration, and
failed for the finisher cases mentioned above.

As `type` has an array value in this case:

  ['mapOnDatabaseColumn' => 'foo']

it can not be used as `$key` argument for `array_key_exists`.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
  • Verified V +2 Done
    • Benjamin Franzke +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 34

  1. Benjamin Franzke commented on patch set 1 11/19/23, 22:42

    Cherry Picked from branch main.
  2. Benjamin Franzke voted on patch set 1 V +2 CR +2 11/19/23, 22:42

  3. core-ci voted on patch set 1 V +1 11/19/23, 22:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49113

  4. Benjamin Franzke merged patch set 2 11/20/23, 22:01