Skip to content

Commit f7dfbba

Browse files
committed
Merge branch '9.0' into feature/3732-cr-privileges
2 parents 9103145 + c4dcecc commit f7dfbba

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

Classes/ContentRepository/Service/WorkspaceService.php

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Neos\Neos\Ui\ContentRepository\Service;
34

45
/*
@@ -14,8 +15,8 @@
1415
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindClosestNodeFilter;
1516
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
1617
use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints;
17-
use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress;
1818
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
19+
use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress;
1920
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
2021
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
2122
use Neos\Flow\Annotations as Flow;
@@ -51,11 +52,12 @@ class WorkspaceService
5152
public function getPublishableNodeInfo(WorkspaceName $workspaceName, ContentRepositoryId $contentRepositoryId): array
5253
{
5354
$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);
55+
$contentGraph = $contentRepository->getContentGraph($workspaceName);
5456
$pendingChanges = $this->workspacePublishingService->pendingWorkspaceChanges($contentRepositoryId, $workspaceName);
5557
/** @var array{contextPath:string,documentContextPath:string,typeOfChange:int}[] $unpublishedNodes */
5658
$unpublishedNodes = [];
5759
foreach ($pendingChanges as $change) {
58-
if ($change->removalAttachmentPoint) {
60+
if ($change->removalAttachmentPoint && $change->originDimensionSpacePoint !== null) {
5961
$nodeAddress = NodeAddress::create(
6062
$contentRepositoryId,
6163
$workspaceName,
@@ -79,20 +81,31 @@ public function getPublishableNodeInfo(WorkspaceName $workspaceName, ContentRepo
7981
'typeOfChange' => $this->getTypeOfChange($change)
8082
];
8183
} else {
82-
$subgraph = $contentRepository->getContentGraph($workspaceName)->getSubgraph(
83-
$change->originDimensionSpacePoint->toDimensionSpacePoint(),
84-
VisibilityConstraints::withoutRestrictions()
85-
);
86-
$node = $subgraph->findNodeById($change->nodeAggregateId);
87-
88-
if ($node instanceof Node) {
89-
$documentNode = $subgraph->findClosestNode($node->aggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT));
90-
if ($documentNode instanceof Node) {
91-
$unpublishedNodes[] = [
92-
'contextPath' => NodeAddress::fromNode($node)->toJson(),
93-
'documentContextPath' => NodeAddress::fromNode($documentNode)->toJson(),
94-
'typeOfChange' => $this->getTypeOfChange($change)
95-
];
84+
if ($change->originDimensionSpacePoint !== null) {
85+
$originDimensionSpacePoints = [$change->originDimensionSpacePoint];
86+
} else {
87+
// If originDimensionSpacePoint is null, we have a change to the nodeAggregate. All nodes in the
88+
// occupied dimensionspacepoints shall be marked as changed.
89+
$originDimensionSpacePoints = $contentGraph
90+
->findNodeAggregateById($change->nodeAggregateId)
91+
?->occupiedDimensionSpacePoints ?: [];
92+
}
93+
94+
foreach ($originDimensionSpacePoints as $originDimensionSpacePoint) {
95+
$subgraph = $contentGraph->getSubgraph(
96+
$originDimensionSpacePoint->toDimensionSpacePoint(),
97+
VisibilityConstraints::withoutRestrictions()
98+
);
99+
$node = $subgraph->findNodeById($change->nodeAggregateId);
100+
if ($node instanceof Node) {
101+
$documentNode = $subgraph->findClosestNode($node->aggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT));
102+
if ($documentNode instanceof Node) {
103+
$unpublishedNodes[] = [
104+
'contextPath' => NodeAddress::fromNode($node)->toJson(),
105+
'documentContextPath' => NodeAddress::fromNode($documentNode)->toJson(),
106+
'typeOfChange' => $this->getTypeOfChange($change)
107+
];
108+
}
96109
}
97110
}
98111
}

Classes/Domain/Service/NodePropertyConverterService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private function getReference(Node $node, string $referenceName): array|string|n
135135
private function getProperty(Node $node, string $propertyName): mixed
136136
{
137137
if ($propertyName === '_hidden') {
138-
return $node->tags->contain(SubtreeTag::fromString('disabled'));
138+
return $node->tags->withoutInherited()->contain(SubtreeTag::fromString('disabled'));
139139
}
140140

141141
$propertyValue = $node->getProperty($propertyName);

0 commit comments

Comments
 (0)