Skip to content

Commit

Permalink
test(php81): fix Undefined array key errors in acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
twojtylak committed Jun 16, 2023
1 parent 30ce56d commit f53be0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Classes/Controller/JsonApiCollectionCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function read(ServerRequestInterface $request): ResponseInterface
$this->parseFieldsets($queryParams);

$pageParams = $queryParams['page'] ?? [];
$currentCursor = $pageParams['cursor'];
$previousCursor = $pageParams['previous'];
$currentCursor = $pageParams['cursor'] ?? null;
$previousCursor = $pageParams['previous'] ?? null;
$limit = $pageParams['limit'] ? (int) $pageParams['limit'] : 10;

$filters = isset($queryParams['filter']) && \is_array($queryParams['filter']) ? $queryParams['filter'] : [];
Expand Down
3 changes: 2 additions & 1 deletion Classes/Controller/JsonApiItemCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public function read(ServerRequestInterface $request): ResponseInterface

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

$data = $this->fetchAndTransformData($resourceIdentifier, $request->getAttributes()['context']);
$context = $request->getAttributes()['context'] ?? null;
$data = $this->fetchAndTransformData($resourceIdentifier, $context);

if (null === $data) {
return new JsonResponse($data, 404, ['Content-Type' => 'application/vnd.api+json; charset=utf-8']);
Expand Down
2 changes: 1 addition & 1 deletion Classes/IncludeHandler/TcaResourceIncludeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function buildTcaIncludes($tableName): array

break;
case 'group':
if ('db' === $columnConfig['internal_type'] && !empty($columnConfig['allowed']) && false === \strpos($columnConfig['allowed'], ',')) {
if ('db' === ($columnConfig['internal_type'] ?? null) && !empty($columnConfig['allowed']) && false === \strpos($columnConfig['allowed'], ',')) {
return \array_merge($columnConfig, [static::REFERENCE_TABLE_NAME => GeneralUtility::trimExplode(',', $columnConfig['allowed'], true)]);
}

Expand Down

0 comments on commit f53be0e

Please sign in to comment.