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

Commit adb70eb

Browse files
author
Marvin Kuhn
authored
fixed no dimension bug
1 parent a56bff4 commit adb70eb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Classes/ViewHelpers/PageViewHelper.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected function findErrorPage($requestPath, $statusCode)
7777
})
7878
// filter invalid dimensions
7979
->filter(function ($page) use ($dimension) {
80-
return \in_array($dimension, $page->getDimensions()['language']);
80+
return $dimension !== null ? \in_array($dimension, $page->getDimensions()['language']) : true;
8181
})
8282
// remove pages which are not in the path
8383
->reject(function ($page) use ($requestPath, $dimension) {
@@ -134,15 +134,22 @@ protected function getErrorPages($dimension)
134134
*/
135135
protected function getContext($dimension)
136136
{
137-
return $this->contextFactory->create([
137+
$context = [
138138
'workspaceName' => 'live',
139139
'currentDateTime' => new \Neos\Flow\Utility\Now(),
140-
'dimensions' => ['language' => [$dimension, $this->contentDimensionsConfig['defaultPreset']]],
141-
'targetDimensions' => ['language' => $dimension],
140+
'dimensions' => [],
141+
'targetDimensions' => [],
142142
'invisibleContentShown' => true,
143143
'removedContentShown' => false,
144144
'inaccessibleContentShown' => false
145-
]);
145+
];
146+
147+
if ($dimension !== null) {
148+
$context['dimensions']['language'] = [$dimension, $this->contentDimensionsConfig['defaultPreset']];
149+
$context['targetDimensions']['language'][] = $dimension;
150+
}
151+
152+
return $this->contextFactory->create($context);
146153
}
147154
/**
148155
* get the current dimension preset key

0 commit comments

Comments
 (0)