Skip to content

Commit

Permalink
BUGFIX: properly resolve supertypes and flush abstract ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Schmitt committed Nov 18, 2022
1 parent 1a02e9e commit 8b3a234
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Classes/Infrastructure/ComponentCacheFlusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Neos\ContentRepository\Domain\Model\Workspace;
use Neos\ContentRepository\Domain\NodeType\NodeTypeName;
use Neos\ContentRepository\Domain\Repository\WorkspaceRepository;
use Neos\ContentRepository\Domain\Service\NodeTypeManager;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Persistence\PersistenceManagerInterface;
use Neos\Media\Domain\Model\AssetInterface;
Expand All @@ -33,9 +32,6 @@ class ComponentCacheFlusher
#[Flow\Inject]
protected WorkspaceRepository $workspaceRepository;

#[Flow\Inject]
protected NodeTypeManager $nodeTypeManager;

#[Flow\Inject]
protected PersistenceManagerInterface $persistenceManager;

Expand Down Expand Up @@ -180,11 +176,9 @@ private function handleNodeChange(Node $node, ?string $workspaceName = null): vo
private function resolveAllSuperTypes(NodeType $nodeType): array
{
$superTypes = [];
if (!$nodeType->isAbstract()) {
$superTypes[$nodeType->getName()] = $nodeType;
}
$superTypes[$nodeType->getName()] = $nodeType;

foreach ($this->nodeTypeManager->getSubNodeTypes($nodeType->getName(), true) as $superType) {
foreach ($nodeType->getDeclaredSuperTypes() as $superType) {
$superTypes = array_merge($superTypes, $this->resolveAllSuperTypes($superType));
}

Expand Down

0 comments on commit 8b3a234

Please sign in to comment.