Review 14.3 Merged

97540[BUGFIX] Fix code completion TypeError for dotted scalar TS keys

Benni Mack CR +2 V +2 Normal +167 −11 updated 11/11/26, 14:04

Commit message

`treeWalkCleanup()` decides between a scalar value and a subtree by
inspecting the trailing dot of the array key. When the key ends in a
dot it assumes the value is an array and recurses, but `toArray()` can
place a string under a dotted key if an identifier ends with an escaped
dot (e.g. a CASE selector key "Mr\."). Passing that string to the
array-typed parameter throws a TypeError on the code-completion AJAX
endpoint.

Branch on `is_array()` instead of the key suffix: `toArray()` only ever
puts arrays under dotted keys and strings under non-dotted keys, so the
value type is the reliable discriminator. This fixes both middle and
trailing escaped dots and preserves the trailing dot in the completion
key for value assignments.

This is the trailing-escaped-dot remainder of #84534, whose fix
introduced the key-suffix discriminator without a regression test.
Add a functional test hitting the code completion templates route with
a sys_template fixture containing such a key.

Review

  • Code review CR +2 Done
    • Benni Mack +2
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 69

  1. Benni Mack commented on patch set 1 11/11/26, 13:13

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/backend/Classes/Controller/CodeEditor/CodeCompletionController.php
  2. Benni Mack commented on patch set 2 11/11/26, 13:13

    Published edit on patch set 1.
  3. core-ci voted on patch set 2 V -1 11/11/26, 13:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114081

  4. core-ci voted on patch set 1 V -1 11/11/26, 13:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114080

  5. Benni Mack commented on patch set 3 V -1 11/11/26, 13:46

    Published edit on patch set 2.
  6. Benni Mack marked it ready for review 11/11/26, 13:46

  7. core-ci voted on patch set 3 V +1 11/11/26, 14:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114089

  8. Benni Mack voted on patch set 3 CR +2 V +2 11/11/26, 14:04

  9. Benni Mack merged patch set 4 11/11/26, 14:04