Skip to content

Commit

Permalink
TASK: Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Oct 19, 2023
1 parent 140346b commit 3055ab8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Classes/ContentRepository/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\DiscardIndividualNodesFromWorkspace;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindClosestNodeFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\Projection\Workspace\Workspace;
use Neos\Neos\Domain\Service\NodeTypeNameFactory;
use Neos\Neos\FrontendRouting\NodeAddress;
use Neos\Neos\FrontendRouting\NodeAddressFactory;
Expand Down Expand Up @@ -128,7 +127,6 @@ public function getAllowedTargetWorkspaces(ContentRepository $contentRepository)
$user = $this->domainUserService->getCurrentUser();

$workspacesArray = [];
/** @var Workspace $workspace */
foreach ($contentRepository->getWorkspaceFinder()->findAll() as $workspace) {
// FIXME: This check should be implemented through a specialized Workspace Privilege or something similar
// Skip workspace not owned by current user
Expand Down Expand Up @@ -193,7 +191,7 @@ public function predictRemoveNodeFeedbackFromDiscardIndividualNodesFromWorkspace

$childNode = $subgraph->findNodeById($nodeToDiscard->nodeAggregateId);
$parentNode = $subgraph->findParentNode($nodeToDiscard->nodeAggregateId);
if ($parentNode) {
if ($childNode && $parentNode) {
$result[] = new RemoveNode($childNode, $parentNode);
$handledNodes[] = $nodeToDiscard;
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Model/Changes/AbstractStructuralChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function getSiblingDomAddress(): ?RenderedNodeDomAddress
*/
public function getSiblingNode(): ?Node
{
if ($this->siblingDomAddress === null) {
if ($this->siblingDomAddress === null || !$this->getSubject()) {
return null;
}

Expand Down Expand Up @@ -152,7 +152,7 @@ protected function finish(Node $node)
// 1) the parent of our new (or copied or moved) node is a ContentCollection;
// so we can directly update an element of this content collection

$contentRepository = $this->contentRepositoryRegistry->get($parentNode->subgraphIdentity->contentRepositoryId);
$contentRepository = $this->contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId);
if ($parentNode && $this->getNodeType($parentNode)->isOfType('Neos.Neos:ContentCollection') &&
// 2) the parent DOM address (i.e. the closest RENDERED node in DOM is actually the ContentCollection;
// and no other node in between
Expand Down

0 comments on commit 3055ab8

Please sign in to comment.