Skip to content

Commit

Permalink
fix: check for flexform/configured table in content element
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Sep 4, 2024
1 parent d4d50da commit 129839c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Classes/Preview/ContentElementPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions phpstan.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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\\<string, array\\<string, mixed\\>\\>, 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
Expand Down

0 comments on commit 129839c

Please sign in to comment.