Skip to content

Commit

Permalink
after CR
Browse files Browse the repository at this point in the history
  • Loading branch information
tischsoic committed May 23, 2024
1 parent 5e7656d commit bc29202
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions src/bundle/Controller/Content/ContentTreeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,17 @@ private function isPreviewable(
Content $content,
string $languageCode
): bool {
$canPreview = $this->permissionResolver->canUser(
'content',
'versionread',
$content,
[$location]
);

if (!$canPreview) {
return false;
}

$versionNo = $content->getVersionInfo()->versionNo;

$siteAccesses = $this->siteaccessResolver->getSiteAccessesListForLocation(
Expand All @@ -277,14 +288,7 @@ private function isPreviewable(
$languageCode
);

$canPreview = $this->permissionResolver->canUser(
'content',
'versionread',
$content,
[$location]
);

return $canPreview && !empty($siteAccesses);
return !empty($siteAccesses);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/UI/Module/ContentTree/NodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ private function buildNode(
}

$translations = $versionInfo->languageCodes;
$mainLanguageCode = $content->contentInfo->mainLanguageCode;
$mainLanguageCode = $versionInfo->getContentInfo()->getMainLanguageCode();

return new Node(
$depth,
Expand Down

0 comments on commit bc29202

Please sign in to comment.