diff --git a/Classes/Preview/ContentElementPreviewRenderer.php b/Classes/Preview/ContentElementPreviewRenderer.php index c5efcec..82ff50d 100644 --- a/Classes/Preview/ContentElementPreviewRenderer.php +++ b/Classes/Preview/ContentElementPreviewRenderer.php @@ -41,8 +41,8 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string $record = $item->getRecord(); - $flexForm = GeneralUtility::xml2array($record['pi_flexform']); - $tableId = (int) $this->getValueFromFlexform($flexForm, 'table'); + $flexForm = GeneralUtility::xml2array($record['pi_flexform'] ?? ''); + $tableId = \is_array($flexForm) ? ((int) $this->getValueFromFlexform($flexForm, 'table')) : 0; try { $table = $this->tableRepository->findByUid($tableId); diff --git a/phpstan.baseline.neon b/phpstan.baseline.neon index 01302d6..f01f53b 100644 --- a/phpstan.baseline.neon +++ b/phpstan.baseline.neon @@ -35,11 +35,6 @@ parameters: count: 1 path: Classes/DataProcessing/TableProcessor.php - - - message: "#^Parameter \\#1 \\$flexForm of method JobRouter\\\\AddOn\\\\Typo3Data\\\\Preview\\\\ContentElementPreviewRenderer\\:\\:getValueFromFlexform\\(\\) expects array\\\\>, array\\|string given\\.$#" - count: 1 - path: Classes/Preview/ContentElementPreviewRenderer.php - - message: "#^Method JobRouter\\\\AddOn\\\\Typo3Data\\\\Synchronisation\\\\CustomTableSynchroniser\\:\\:storeDatasets\\(\\) has parameter \\$customTableColumns with no value type specified in iterable type array\\.$#" count: 1