diff --git a/Routing/ArticleRouteDefaultProvider.php b/Routing/ArticleRouteDefaultProvider.php index 9ec36b0fc..83e48fc26 100644 --- a/Routing/ArticleRouteDefaultProvider.php +++ b/Routing/ArticleRouteDefaultProvider.php @@ -118,7 +118,13 @@ public function getByEntity($entityClass, $id, $locale, $object = null) */ public function isPublished($entityClass, $id, $locale) { - $object = $this->documentManager->find($id, $locale); + $object = $this->documentManager->find( + $id, + $locale, + [ + 'load_ghost_content' => false, + ] + ); if (!$object instanceof ArticleInterface || WorkflowStage::PUBLISHED !== $object->getWorkflowStage()) { return false; diff --git a/Tests/Unit/Routing/ArticleRouteDefaultProviderTest.php b/Tests/Unit/Routing/ArticleRouteDefaultProviderTest.php index bb6c0205b..fce25d558 100644 --- a/Tests/Unit/Routing/ArticleRouteDefaultProviderTest.php +++ b/Tests/Unit/Routing/ArticleRouteDefaultProviderTest.php @@ -130,7 +130,13 @@ public function testIsPublished( $this->webspaceResolver->resolveAdditionalWebspaces($document)->willReturn($documentAdditionalWebspaces); } - $this->documentManager->find($this->entityId, $this->locale)->willReturn($document); + $this->documentManager->find( + $this->entityId, + $this->locale, + [ + 'load_ghost_content' => false, + ] + )->willReturn($document); $webspace = $this->prophesize(Webspace::class); $webspace->getKey()->willReturn($webspaceKey);