diff --git a/src/bundle/Controller/ContentViewController.php b/src/bundle/Controller/ContentViewController.php index 368c298d8f..05b30d4ff7 100644 --- a/src/bundle/Controller/ContentViewController.php +++ b/src/bundle/Controller/ContentViewController.php @@ -168,7 +168,6 @@ public function locationViewAction(Request $request, ContentView $view): Content $this->supplyPathLocations($view); $this->subitemsContentViewParameterSupplier->supply($view); $this->supplyContentActionForms($view); - $this->supplyIsLocationInvisible($view); $this->supplyContentReverseRelations($view); $this->supplyContentTreeParameters($view); } @@ -567,22 +566,4 @@ function (Repository $repository) use ($contentInfo) { $view->addParameters(['content_has_reverse_relations' => \count($relations) > 0]); } - - /** - * @param \eZ\Publish\Core\MVC\Symfony\View\ContentView $view - */ - private function supplyIsLocationInvisible(ContentView $view) - { - $location = $view->getLocation(); - $parentLocation = $this->permissionResolver->sudo( - function (Repository $repository) use ($location) { - return $repository->getLocationService()->loadLocation($location->parentLocationId); - }, - $this->repository - ); - $isLocationVisible = !($parentLocation->hidden || $parentLocation->invisible); - - // Location is invisible when parent location is not visible. - $view->addParameters(['is_location_visible' => $isLocationVisible]); - } } diff --git a/src/bundle/Resources/views/content/locationview.html.twig b/src/bundle/Resources/views/content/locationview.html.twig index 900ec82a2f..b9ba3772c8 100644 --- a/src/bundle/Resources/views/content/locationview.html.twig +++ b/src/bundle/Resources/views/content/locationview.html.twig @@ -63,6 +63,7 @@