#110701TypoScript code-completion crashes with TypeError on a trailing escaped dot in a key
Description
A TypeError is thrown from the TypoScript code-completion AJAX endpoint whenever a page’s merged TypoScript contains a scalar value stored under a key whose identifier ends in a dot. A realistic trigger is a CASE selector key with a trailing literal dot:
lib.foo = CASE
lib.foo {
Mr\. = TEXT
Mr\. {
value = Sehr geehrter Herr
}
}
Core: Exception handler (WEB): Uncaught TYPO3 Exception: TYPO3\CMS\Backend\Controller\CodeEditor\CodeCompletionController::treeWalkCleanup(): Argument #1 ($treeBranch) must be of type array, string given, called in .../typo3/sysext/backend/Classes/Controller/CodeEditor/CodeCompletionController.php on line 110
Requested URL: /typo3/ajax/code-editor/codecompletion/load-templates?pageId=151
*Reproduction*
1. Log in as admin, open TypoScript module on a page and edit the `sys_template` Setup/Constants field.
2. The AJAX call fires automatically on editor init (not only on Ctrl+Space).
3. Include the CASE snippet above in any template up the page’s rootline.
4. The request 500s and writes a `TypeError` to the log.
Root cause
if (substr($key, -1) !== '.') {
// value-assignment branch
} else {
$subBranch = $this->treeWalkCleanup($value); // assumes $value is an array
}
When the key ends in ., the code assumes the value is an array and recurses, but RootNode::toArray() / AbstractChildNode::toArray() place a string under a dotted key (the trailing-escaped-dot case). Passing that string to the array-typed $treeBranch throws the TypeError. The recursion guard is keyed on the key suffix while assuming the value type – a mismatch that crashes instead of skipping the malformed node.
Reviews 2
Related issues 1
History 39
-
Gerrit Code Review pushed patch set 1 for main to change 95812 status
NewUnder Review <span data-processor="relativetime" data-value="2026-09-14T14:29:01+00:00" > 09/14/26, 14:29 </span> -
Anton Danilov changed Related to #84534 <span data-processor="relativetime" data-value="2026-09-14T14:30:37+00:00" > 09/14/26, 14:30 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 95812 <span data-processor="relativetime" data-value="2026-10-22T15:09:45+00:00" > 10/22/26, 15:09 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95812 <span data-processor="relativetime" data-value="2026-11-10T18:36:16+00:00" > 11/10/26, 18:36 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97540 <span data-processor="relativetime" data-value="2026-11-11T13:13:28+00:00" > 11/11/26, 13:13 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 97540 <span data-processor="relativetime" data-value="2026-11-11T13:14:02+00:00" > 11/11/26, 13:14 </span>
-
Anton Danilov commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-11T13:20:11+00:00" > 11/11/26, 13:20 </span> -
Gerrit Code Review pushed patch set 3 for 14.3 to change 97540 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-11-11T13:46:50+00:00" > 11/11/26, 13:46 </span> -
Anton Danilov commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-11-11T14:10:03+00:00" > 11/11/26, 14:10 </span>Applied in changeset commit:b0c09a9bf59a8255703f2c437390d84197ea5515.
Applied in changeset commit:a9fd86269a0e39110a2cfaa5b9ea150f5a3d9cb7.