Issue Bug Closed

#106975Fix option `maxItemsInResultList` in SuggestWizardController

Kai Strecker 06/25/25, 15:29 updated 12/02/25, 14:37

Description

Setting a page tsconfig like TCEFORM.<table>.<field>.suggest.default.maxItemsInResultList = 20 leads to an error in SuggestWizardController when calling array_splice and passing the number as the second parameter, because the parsed value is never cast to a number, and therefore remains a string. The bug is in this line: https://github.com/TYPO3/typo3/blob/v13.4.14/typo3/sysext/backend/Classes/Controller/Wizard/SuggestWizardController.php#L190

It currently is

$maxItems = $config['maxItemsInResultList'] ?? 10;

but it should be

$maxItems = (int)($config['maxItemsInResultList'] ?? 10);

Thanks for fixing!

Reviews 3