From 1bdd64fb0edc80ab4beaeb744ce4967f0e24b752 Mon Sep 17 00:00:00 2001 From: Lukas Niestroj Date: Fri, 4 Dec 2020 10:57:17 +0100 Subject: [PATCH] [BUGFIX] explicitly check if the colPos value is inside an array --- Classes/Form/FormDataProvider/TcaCTypeItems.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Form/FormDataProvider/TcaCTypeItems.php b/Classes/Form/FormDataProvider/TcaCTypeItems.php index 62447c6..0da7f7e 100644 --- a/Classes/Form/FormDataProvider/TcaCTypeItems.php +++ b/Classes/Form/FormDataProvider/TcaCTypeItems.php @@ -36,7 +36,11 @@ public function addData(array $result) $pageId = !empty($result['effectivePid']) ? (int)$result['effectivePid'] : (int)$result['databaseRow']['pid']; $backendLayoutConfiguration = BackendLayoutConfiguration::createFromPageId($pageId); - $colPos = (int)($result['databaseRow']['colPos'][0] ?? ($result['databaseRow']['colPos'] ?? 0)); + if (is_array($result['databaseRow']['colPos'])) { + $colPos = (int)$result['databaseRow']['colPos'][0]; + } else { + $colPos = (int)$result['databaseRow']['colPos']; + } $columnConfiguration = $backendLayoutConfiguration->getConfigurationByColPos($colPos, $result['databaseRow']['uid']); if (empty($columnConfiguration) || (empty($columnConfiguration['allowed.']) && empty($columnConfiguration['disallowed.']))) { return $result;