Skip to content

Commit

Permalink
Fixed read of page for home page in user bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM authored and Daniel Berthereau committed Jan 3, 2022
1 parent c31d814 commit 43b7e64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/src/View/Helper/UserBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ protected function links(RendererInterface $view, SiteRepresentation $site, User
'url' => $url('admin/site/slug/action', ['site-slug' => $site->slug(), 'action' => 'page']),
];
try {
$page = $view->api()->read('site_pages', ['site' => $site->id(), 'slug' => $routeParams['page-slug']])->getContent();
$page = empty($routeParams['page-slug'])
? $site->homepage()
: $view->api()->read('site_pages', ['site' => $site->id(), 'slug' => $routeParams['page-slug']])->getContent();
if ($page->userIsAllowed('edit')) {
$links[] = [
'resource' => $controller,
Expand Down

0 comments on commit 43b7e64

Please sign in to comment.