Skip to content

Commit

Permalink
Merge branch '9.0' into bugfix/nodeInfoHelperIsAutoCreated
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Schmitt committed Sep 15, 2023
2 parents c85c241 + 7a6c923 commit 281cf66
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 30 deletions.
1 change: 0 additions & 1 deletion Classes/ContentRepository/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
*/
class WorkspaceService
{

/**
* @Flow\Inject
* @var UserService
Expand Down
11 changes: 3 additions & 8 deletions Classes/Controller/BackendServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,9 @@ public function changeBaseWorkspaceAction(string $targetWorkspaceName, string $d
$currentAccount->getAccountIdentifier()
)->toContentRepositoryWorkspaceName();

$command = ChangeBaseWorkspace::create($userWorkspaceName, WorkspaceName::fromString($targetWorkspaceName));
try {
$contentRepository->handle(
new ChangeBaseWorkspace(
$userWorkspaceName,
WorkspaceName::fromString($targetWorkspaceName),
$newCOnt = ContentStreamId::create()
)
)->block();
$contentRepository->handle($command)->block();
} catch (WorkspaceIsNotEmptyException $exception) {
$error = new Error();
$error->setMessage('Your personal workspace currently contains unpublished changes.'
Expand All @@ -366,7 +361,7 @@ public function changeBaseWorkspaceAction(string $targetWorkspaceName, string $d

$subgraph = $contentRepository->getContentGraph()
->getSubgraph(
$newCOnt,
$command->newContentStreamId,
$nodeAddress->dimensionSpacePoint,
VisibilityConstraints::withoutRestrictions()
);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/Changes/AbstractCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function createNode(

$nodeAggregateId = NodeAggregateId::create(); // generate a new NodeAggregateId

$command = new CreateNodeAggregateWithNode(
$command = CreateNodeAggregateWithNode::create(
$parentNode->subgraphIdentity->contentStreamId,
$nodeAggregateId,
$nodeTypeName,
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Changes/MoveAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public function apply(): void
$hasEqualParentNode = $parentNode->nodeAggregateId
->equals($parentNodeOfPreviousSibling->nodeAggregateId);

$command = new MoveNodeAggregate(
$command = MoveNodeAggregate::create(
$subject->subgraphIdentity->contentStreamId,
$subject->subgraphIdentity->dimensionSpacePoint,
$subject->nodeAggregateId,
RelationDistributionStrategy::STRATEGY_GATHER_ALL,
$hasEqualParentNode ? null : $parentNodeOfPreviousSibling->nodeAggregateId,
$precedingSibling->nodeAggregateId,
$succeedingSibling?->nodeAggregateId,
RelationDistributionStrategy::STRATEGY_GATHER_ALL
);

$contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId);
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Changes/MoveBefore.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ public function apply(): void
$contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId);

$contentRepository->handle(
new MoveNodeAggregate(
MoveNodeAggregate::create(
$subject->subgraphIdentity->contentStreamId,
$subject->subgraphIdentity->dimensionSpacePoint,
$subject->nodeAggregateId,
RelationDistributionStrategy::STRATEGY_GATHER_ALL,
$hasEqualParentNode
? null
: $succeedingSiblingParent->nodeAggregateId,
$precedingSibling?->nodeAggregateId,
$succeedingSibling->nodeAggregateId,
RelationDistributionStrategy::STRATEGY_GATHER_ALL
)
)->block();

Expand Down
6 changes: 2 additions & 4 deletions Classes/Domain/Model/Changes/MoveInto.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,12 @@ public function apply(): void

$contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId);
$contentRepository->handle(
new MoveNodeAggregate(
MoveNodeAggregate::create(
$subject->subgraphIdentity->contentStreamId,
$subject->subgraphIdentity->dimensionSpacePoint,
$subject->nodeAggregateId,
RelationDistributionStrategy::STRATEGY_GATHER_ALL,
$hasEqualParentNode ? null : $parentNode->nodeAggregateId,
null,
null,
RelationDistributionStrategy::STRATEGY_GATHER_ALL
)
)->block();

Expand Down
10 changes: 5 additions & 5 deletions Classes/Domain/Model/Changes/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function apply(): void
$originDimensionSpacePoint = OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->subgraphIdentity->dimensionSpacePoint);
// if origin dimension space point != current DSP -> translate transparently (matching old behavior)
$contentRepository->handle(
new CreateNodeVariant(
CreateNodeVariant::create(
$subject->subgraphIdentity->contentStreamId,
$subject->nodeAggregateId,
$subject->originDimensionSpacePoint,
Expand All @@ -200,7 +200,7 @@ public function apply(): void
)->block();
}
$commandResult = $contentRepository->handle(
new SetNodeProperties(
SetNodeProperties::create(
$subject->subgraphIdentity->contentStreamId,
$subject->nodeAggregateId,
$originDimensionSpacePoint,
Expand All @@ -215,7 +215,7 @@ public function apply(): void
// property starts with "_"
if ($propertyName === '_nodeType') {
$commandResult = $contentRepository->handle(
new ChangeNodeAggregateType(
ChangeNodeAggregateType::create(
$subject->subgraphIdentity->contentStreamId,
$subject->nodeAggregateId,
NodeTypeName::fromString($value),
Expand All @@ -225,7 +225,7 @@ public function apply(): void
} elseif ($propertyName === '_hidden') {
if ($value === true) {
$commandResult = $contentRepository->handle(
new DisableNodeAggregate(
DisableNodeAggregate::create(
$subject->subgraphIdentity->contentStreamId,
$subject->nodeAggregateId,
$subject->originDimensionSpacePoint->toDimensionSpacePoint(),
Expand All @@ -235,7 +235,7 @@ public function apply(): void
} else {
// unhide
$commandResult = $contentRepository->handle(
new EnableNodeAggregate(
EnableNodeAggregate::create(
$subject->subgraphIdentity->contentStreamId,
$subject->nodeAggregateId,
$subject->originDimensionSpacePoint->toDimensionSpacePoint(),
Expand Down
6 changes: 4 additions & 2 deletions Classes/Domain/Model/Changes/Remove.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ public function apply(): void
$this->updateWorkspaceInfo();

$closestDocumentParentNode = $this->findClosestDocumentNode($subject);
$command = new RemoveNodeAggregate(
$command = RemoveNodeAggregate::create(
$subject->subgraphIdentity->contentStreamId,
$subject->nodeAggregateId,
$subject->subgraphIdentity->dimensionSpacePoint,
NodeVariantSelectionStrategy::STRATEGY_ALL_SPECIALIZATIONS,
$closestDocumentParentNode?->nodeAggregateId
);
if ($closestDocumentParentNode !== null) {
$command = $command->withRemovalAttachmentPoint($closestDocumentParentNode?->nodeAggregateId);
}

$contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId);
$contentRepository->handle($command)->block();
Expand Down
1 change: 0 additions & 1 deletion Classes/Domain/Model/ReferencingChangeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Neos\ContentRepository\Core\Projection\ContentGraph\Node;


/**
* A change that needs to reference another node
*/
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Service/NodePropertyConverterService.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function getProperty(Node $node, $propertyName)
);

return $this->toNodeIdentifierStrings($references);
// Here, the normal property access logic starts.
// Here, the normal property access logic starts.
} elseif ($propertyName[0] === '_' && $propertyName !== '_hiddenInIndex') {
$propertyValue = ObjectAccess::getProperty($node, ltrim($propertyName, '_'));
} else {
Expand Down
4 changes: 2 additions & 2 deletions Classes/Fusion/Helper/NodeInfoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ protected function renderChildrenInformation(Node $node, string $nodeTypeFilterS
// child nodes for content tree, must not include those nodes filtered out by `baseNodeType`
$contentChildNodes = $subgraph->findChildNodes(
$node->nodeAggregateId,
FindChildNodesFilter::create(nodeTypeConstraints:
$this->buildContentChildNodeFilterString()
FindChildNodesFilter::create(
nodeTypeConstraints: $this->buildContentChildNodeFilterString()
)
);
$childNodes = $documentChildNodes->merge($contentChildNodes);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/PublishingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function publishWorkspace(ContentRepository $contentRepository, Workspace
)->block();

$contentRepository->handle(
new PublishWorkspace(
PublishWorkspace::create(
$workspaceName
)
)->block();
Expand Down

0 comments on commit 281cf66

Please sign in to comment.