Skip to content

Commit 747502b

Browse files
committed
[BUGFIX] Except when 'renderType' is not string in NodeFactory
In cases where `array_merge_recursive` is used to append to a TCA configuration multiple times with the same key, it will lead to transforming an array key with a single value to an array of values instead. The NodeFactory can not deal with this case. This patch throws an exception in case no string is found, and tries to hint at this possible array scenario. Resolves: #106177 Releases: main, 13.4, 12.4 Change-Id: I98ce2bafeabed23cfff6246f4f56918991366396 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88261 Tested-by: core-ci <typo3@b13.com> Tested-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Garvin Hicking <gh@faktor-e.de> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
1 parent 21d14b3 commit 747502b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

typo3/sysext/backend/Classes/Form/NodeFactory.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ public function create(array $data): NodeInterface
159159
}
160160
$type = $data['renderType'];
161161

162+
if (!is_string($type)) {
163+
throw new Exception(
164+
'"renderType" in TCA of field "[' . ($data['tableName'] ?? 'unknown') . '][' . ($data['fieldName'] ?? 'unknown') . ']" does not contain a string. It might be an array instead of a string which could be the result of an array_merge_recursive() operation, for example on existing "fieldControl" keys (these need to have unique array key indices).',
165+
1739882175
166+
);
167+
}
162168
$className = $this->nodeTypes[$type] ?? $this->nodeTypes['unknown'];
163169

164170
if (!empty($this->nodeResolver[$type])) {

0 commit comments

Comments
 (0)