Skip to content

Commit

Permalink
Merge pull request #41 from kitsunet/FEATURE/testing
Browse files Browse the repository at this point in the history
TASK: Fix Workspace persistence error
  • Loading branch information
gradinarufelix authored Mar 4, 2024
2 parents 2f6d4fd + 90119b4 commit a25081d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Classes/ContentRepository/NodeTranslationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Neos\ContentRepository\Domain\Model\Workspace;
use Neos\ContentRepository\Domain\Service\Context;
use Neos\ContentRepository\Domain\Service\ContextFactory;
use Neos\ContentRepository\Domain\Service\ContextFactoryInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\Service\PublishingService;
use Neos\Neos\Utility\NodeUriPathSegmentGenerator;
Expand Down Expand Up @@ -72,7 +73,7 @@ class NodeTranslationService

/**
* @Flow\Inject
* @var ContextFactory
* @var ContextFactoryInterface
*/
protected $contextFactory;

Expand Down Expand Up @@ -315,4 +316,9 @@ public function syncNode(NodeInterface $sourceNode, string $workspaceName = 'liv
}
}
}

public function resetContextCache(): void
{
$this->contextFirstLevelCache = [];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ protected function saveNodesAndTearDown(): void
$nodeFactory = $this->objectManager->get(NodeFactory::class);
$nodeFactory->reset();
$this->contextFactory->reset();
$nodeTranslationService = $this->objectManager->get(NodeTranslationService::class);
$nodeTranslationService->resetContextCache();

$this->persistenceManager->persistAll();
$this->persistenceManager->clearState();
Expand Down

0 comments on commit a25081d

Please sign in to comment.