From 43b7e6446609904d24047d9e23fd821e4fcb4844 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 6 Jan 2020 00:00:00 +0100 Subject: [PATCH] Fixed read of page for home page in user bar. --- application/src/View/Helper/UserBar.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/src/View/Helper/UserBar.php b/application/src/View/Helper/UserBar.php index 8a35c16a51..5ca0a1ad7d 100644 --- a/application/src/View/Helper/UserBar.php +++ b/application/src/View/Helper/UserBar.php @@ -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,