Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Commit

Permalink
fixed no dimension bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Kuhn authored Jan 23, 2018
1 parent a56bff4 commit adb70eb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Classes/ViewHelpers/PageViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function findErrorPage($requestPath, $statusCode)
})
// filter invalid dimensions
->filter(function ($page) use ($dimension) {
return \in_array($dimension, $page->getDimensions()['language']);
return $dimension !== null ? \in_array($dimension, $page->getDimensions()['language']) : true;
})
// remove pages which are not in the path
->reject(function ($page) use ($requestPath, $dimension) {
Expand Down Expand Up @@ -134,15 +134,22 @@ protected function getErrorPages($dimension)
*/
protected function getContext($dimension)
{
return $this->contextFactory->create([
$context = [
'workspaceName' => 'live',
'currentDateTime' => new \Neos\Flow\Utility\Now(),
'dimensions' => ['language' => [$dimension, $this->contentDimensionsConfig['defaultPreset']]],
'targetDimensions' => ['language' => $dimension],
'dimensions' => [],
'targetDimensions' => [],
'invisibleContentShown' => true,
'removedContentShown' => false,
'inaccessibleContentShown' => false
]);
];

if ($dimension !== null) {
$context['dimensions']['language'] = [$dimension, $this->contentDimensionsConfig['defaultPreset']];
$context['targetDimensions']['language'][] = $dimension;
}

return $this->contextFactory->create($context);
}
/**
* get the current dimension preset key
Expand Down

0 comments on commit adb70eb

Please sign in to comment.