Skip to content

Commit 1831094

Browse files
authored
Merge pull request #3866 from neos/task/4634-make-content-repository-service-internal
Task/4634 make content repository service internal
2 parents fe52b16 + 79a7154 commit 1831094

6 files changed

+8
-143
lines changed

Classes/Controller/BackendController.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,11 @@ public function indexAction(string $node = null)
151151
}
152152
$contentGraph = $contentRepository->getContentGraph($workspace->workspaceName);
153153

154-
$backendControllerInternals = $this->contentRepositoryRegistry->buildService(
155-
$siteDetectionResult->contentRepositoryId,
156-
new BackendControllerInternalsFactory()
157-
);
158-
$defaultDimensionSpacePoint = $backendControllerInternals->getDefaultDimensionSpacePoint();
154+
$rootDimensionSpacePoints = $contentRepository->getVariationGraph()->getRootGeneralizations();
155+
$arbitraryRootDimensionSpacePoint = array_shift($rootDimensionSpacePoints);
159156

160157
$subgraph = $contentGraph->getSubgraph(
161-
$nodeAddress ? $nodeAddress->dimensionSpacePoint : $defaultDimensionSpacePoint,
158+
$nodeAddress ? $nodeAddress->dimensionSpacePoint : $arbitraryRootDimensionSpacePoint,
162159
VisibilityConstraints::withoutRestrictions()
163160
);
164161

@@ -170,7 +167,7 @@ public function indexAction(string $node = null)
170167
if (!$rootNodeAggregate) {
171168
throw new \RuntimeException(sprintf('No sites root node found in content repository "%s", while fetching site node "%s"', $contentRepository->id->value, $siteDetectionResult->siteNodeName->value), 1724849303);
172169
}
173-
$rootNode = $rootNodeAggregate->getNodeByCoveredDimensionSpacePoint($defaultDimensionSpacePoint);
170+
$rootNode = $rootNodeAggregate->getNodeByCoveredDimensionSpacePoint($arbitraryRootDimensionSpacePoint);
174171

175172
$siteNode = $subgraph->findNodeByPath(
176173
$siteDetectionResult->siteNodeName->toNodeName(),

Classes/Controller/BackendControllerInternals.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

Classes/Controller/BackendControllerInternalsFactory.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

Classes/Fusion/Helper/ContentDimensionsHelper.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ class ContentDimensionsHelper implements ProtectedContextAwareInterface
3636
*/
3737
public function contentDimensionsByName(ContentRepositoryId $contentRepositoryId): array
3838
{
39-
$contentDimensionHelperInternals = $this->contentRepositoryRegistry->buildService($contentRepositoryId, new ContentDimensionsHelperInternalsFactory());
40-
assert($contentDimensionHelperInternals instanceof ContentDimensionsHelperInternals);
41-
$contentDimensionSource = $contentDimensionHelperInternals->contentDimensionSource;
42-
39+
$contentDimensionSource = $this->contentRepositoryRegistry->get($contentRepositoryId)
40+
->getContentDimensionSource();
4341
$dimensions = $contentDimensionSource->getContentDimensionsOrderedByPriority();
4442

4543
$result = [];
@@ -72,8 +70,8 @@ public function contentDimensionsByName(ContentRepositoryId $contentRepositoryId
7270
*/
7371
public function allowedPresetsByName(DimensionSpacePoint $dimensions, ContentRepositoryId $contentRepositoryId): array|object
7472
{
75-
$contentDimensionHelperInternals = $this->contentRepositoryRegistry->buildService($contentRepositoryId, new ContentDimensionsHelperInternalsFactory());
76-
$contentDimensionSource = $contentDimensionHelperInternals->contentDimensionSource;
73+
$contentDimensionSource = $this->contentRepositoryRegistry->get($contentRepositoryId)
74+
->getContentDimensionSource();
7775

7876
// TODO: re-implement this here; currently EVERYTHING is allowed!!
7977
$allowedPresets = [];

Classes/Fusion/Helper/ContentDimensionsHelperInternals.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

Classes/Fusion/Helper/ContentDimensionsHelperInternalsFactory.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)