#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 09/14/26, 14:29 -
Anton Danilov changed Related to #84534 09/14/26, 14:30
-
Gerrit Code Review pushed patch set 2 for main to change 95812 10/22/26, 15:09
-
Gerrit Code Review pushed patch set 3 for main to change 95812 11/10/26, 18:36
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97540 11/11/26, 13:13
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 97540 11/11/26, 13:14
-
Anton Danilov commented and changed status
Under ReviewResolved done0 %100 % 11/11/26, 13:20 -
Gerrit Code Review pushed patch set 3 for 14.3 to change 97540 status
ResolvedUnder Review 11/11/26, 13:46 -
Anton Danilov commented and changed status
Under ReviewResolved 11/11/26, 14:10Applied in changeset commit:b0c09a9bf59a8255703f2c437390d84197ea5515.
Applied in changeset commit:a9fd86269a0e39110a2cfaa5b9ea150f5a3d9cb7.