From dd3a1b8a15151126a56b9bb3fa69757337f990e1 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Tue, 25 Jan 2022 11:29:50 +0100 Subject: [PATCH] chg: [appcontroller] Breadcrumbs and notifications are fetched only if the user is logged in --- src/Controller/AppController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index 0a6c623..9a3c8c6 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -153,9 +153,11 @@ class AppController extends Controller public function beforeRender(EventInterface $event) { - if (!$this->ParamHandler->isRest()) { - $this->set('breadcrumb', $this->Navigation->getBreadcrumb()); - $this->set('notifications', $this->Notification->getNotifications()); + if (!empty($this->request->getAttribute('identity'))) { + if (!$this->ParamHandler->isRest()) { + $this->set('breadcrumb', $this->Navigation->getBreadcrumb()); + $this->set('notifications', $this->Notification->getNotifications()); + } } }