Skip to content

Commit

Permalink
Merge pull request #33 from DFAU/fix/undefined-array-key-error
Browse files Browse the repository at this point in the history
fix: fix undefined array key "id" error in fillInCommandArguments
  • Loading branch information
twojtylak committed Dec 27, 2023
2 parents 0ac466c + a1d1272 commit 8c41401
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 8c41401

Please sign in to comment.