fix error pages (#1209)
This commit is contained in:
@@ -7,7 +7,10 @@ home:
|
|||||||
|
|
||||||
homeLocale:
|
homeLocale:
|
||||||
path: /{_locale}
|
path: /{_locale}
|
||||||
|
requirements:
|
||||||
|
_locale: '%app_locales%'
|
||||||
defaults:
|
defaults:
|
||||||
_controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
|
_controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
|
||||||
|
_locale: '%locale%'
|
||||||
route: homepage
|
route: homepage
|
||||||
permanent: true
|
permanent: true
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class DashboardSubscriber implements EventSubscriberInterface
|
|||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
DashboardEvent::DASHBOARD => ['onDashboardEvent', 100],
|
DashboardEvent::class => ['onDashboardEvent', 100],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,10 @@ class MenuBuilderSubscriber implements EventSubscriberInterface
|
|||||||
new MenuItemModel('system', 'menu.system', '')
|
new MenuItemModel('system', 'menu.system', '')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// error pages don't have a user and will fail when is_granted() is called
|
||||||
|
if (null !== $event->getRequest()->getUser()) {
|
||||||
$this->eventDispatcher->dispatch($menuEvent);
|
$this->eventDispatcher->dispatch($menuEvent);
|
||||||
|
}
|
||||||
|
|
||||||
if ($menuEvent->getAdminMenu()->hasChildren()) {
|
if ($menuEvent->getAdminMenu()->hasChildren()) {
|
||||||
$event->addItem(new MenuItemModel('admin', 'menu.admin', ''));
|
$event->addItem(new MenuItemModel('admin', 'menu.admin', ''));
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ final class MenuSubscriber implements EventSubscriberInterface
|
|||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
ConfigureMainMenuEvent::CONFIGURE => ['onMainMenuConfigure', 100],
|
ConfigureMainMenuEvent::class => ['onMainMenuConfigure', 100],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class UserPreferenceSubscriber implements EventSubscriberInterface
|
|||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
PrepareUserEvent::PREPARE => ['loadUserPreferences', 200]
|
PrepareUserEvent::class => ['loadUserPreferences', 200]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user