Skip to content

Commit

Permalink
fix: fix undefined array key "id" error in fillInCommandArguments
Browse files Browse the repository at this point in the history
  • Loading branch information
twojtylak committed Dec 27, 2023
1 parent 0ac466c commit a1d1272
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Controller/JsonApiItemCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function read(ServerRequestInterface $request): ResponseInterface
$this->parseIncludes($queryParams);
$this->parseFieldsets($queryParams);

$resourceIdentifier = \urldecode($request->getAttribute('variables')['id'] ?: '');
$resourceIdentifier = \urldecode($request->getAttribute('variables')['id'] ?? '');

$context = $request->getAttributes()['context'] ?? null;
$data = $this->fetchAndTransformData($resourceIdentifier, $context);
Expand All @@ -78,7 +78,7 @@ protected function fetchAndTransformData(string $resourceIdentifier, ?Context $c

protected function fillInCommandArguments(ServerRequestInterface $request, string $commandName, array $commandArguments, array $commandInterfaces): array
{
$resourceIdentifier = \urldecode($request->getAttribute('variables')['id'] ?: '');
$resourceIdentifier = \urldecode($request->getAttribute('variables')['id'] ?? '');
$commandArguments['resourceIdentifier'] = $resourceIdentifier;
$commandArguments['resourceType'] = $this->resourceType;

Expand Down

0 comments on commit a1d1272

Please sign in to comment.