Skip to content

Commit

Permalink
[TASK] Avoid return type from request parseBody
Browse files Browse the repository at this point in the history
After upgrade psr/http-message to 1.1.0 the method `getParsedBody()` can
return an object in addition to array and null. To avoid errors use only `getQueryParams()`
  • Loading branch information
NarkNiro committed May 17, 2024
1 parent 01b7f2f commit 122c505
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/Event/Listener/GlossarySyncButtonProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public function __invoke(ModifyButtonBarEvent $event): void
$buttons = $event->getButtons();
$request = $this->getRequest();

$id = (int)($request->getParsedBody()['id'] ?? $request->getQueryParams()['id'] ?? 0);
$requestParams = $request->getQueryParams();

$id = (int)($requestParams['id'] ?? 0);
$module = $request->getAttribute('module');
$normalizedParams = $request->getAttribute('normalizedParams');
$pageTSconfig = BackendUtility::getPagesTSconfig($id);
Expand Down

0 comments on commit 122c505

Please sign in to comment.