diff --git a/typo3/sysext/core/Classes/Hooks/TcaItemsProcessorFunctions.php b/typo3/sysext/core/Classes/Hooks/TcaItemsProcessorFunctions.php
index 51bd9bb45884255216371d6d8aaecdd5496906fc..f6bcc43b35889032e8f2ce28e3c0d72b705070b2 100644
--- a/typo3/sysext/core/Classes/Hooks/TcaItemsProcessorFunctions.php
+++ b/typo3/sysext/core/Classes/Hooks/TcaItemsProcessorFunctions.php
@@ -190,7 +190,7 @@ class TcaItemsProcessorFunctions
                 }
                 $fieldDefinition['items'][] = [
                     $languageService->sL($itemConfig[0] ?? ''),
-                    $customOptionsKey . ':' . preg_replace('/[:|,]/', '', $itemKey),
+                    $customOptionsKey . ':' . preg_replace('/[:|,]/', '', (string)$itemKey),
                     $icon,
                     null,
                     $helpText,