Skip to content

Commit

Permalink
[WORKAROUND] Prevent exception while using EXT:container upgrade wizard
Browse files Browse the repository at this point in the history
There are some reported cases, that an exception occurs, if the upgrade
wizard "Migrate container sorting" of EXT:container is executed.

Resolves: #988
  • Loading branch information
mschwemer committed Jun 7, 2024
1 parent 721b6f3 commit e69ca4a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/EventListener/FlexFormParsingModifyEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,16 @@ protected function getSheetNameAndRemoveFromConfiguration(array &$configuration)

private function getPidForCurrentRecord(): int
{
$uid = 0;
$request = $this->getRequest();
$queryParams = $request->getQueryParams();
$uid = array_keys($queryParams['edit']['tt_content'] ?? [])[0] ?? 0;
if ($request) {
$queryParams = $request->getQueryParams();
$uid = array_keys($queryParams['edit']['tt_content'] ?? [])[0] ?? 0;
}
return DatabaseUtility::getPidForRecord($uid, 'tt_content');
}

private function getRequest(): ServerRequestInterface
private function getRequest(): ?ServerRequestInterface
{
return $GLOBALS['TYPO3_REQUEST'];
}
Expand Down

1 comment on commit e69ca4a

@georgringer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot!!

Please sign in to comment.