Skip to content

Commit

Permalink
Merge branch '1.2' of github.com:sulu/SuluArticleBundle into 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Mar 25, 2021
2 parents f7241f9 + b79daf0 commit c7016d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Routing/ArticleRouteDefaultProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,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;
Expand Down
8 changes: 7 additions & 1 deletion Tests/Unit/Routing/ArticleRouteDefaultProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,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);
Expand Down

0 comments on commit c7016d0

Please sign in to comment.