-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Describe the bug
When using the new AdminDashboard
PHP Attribute to set the default route with a locale set, after logging in, the locale is not set in the URL, giving a 404.
To Reproduce
- Create a DashboardController
- Add the following PHP Attribute
#[AdminDashboard('/admin/{_locale}', 'admin')]
- Remove the
var/cache
folder's content and clear Symfony's cache usingphp bin/console cache:clear
Additional context
Setting the route at the index
method level works:
#[IsGranted('ROLE_ADMIN')]
#[Route('/admin/{_locale}', name: 'admin')]
public function index(string $_locale = 'fr'): Response
{
$adminUrlGenerator = $this->container->get(AdminUrlGenerator::class);
return $this->redirect($adminUrlGenerator->setController(ShopifyOrderCrudController::class)->generateUrl());
}
Metadata
Metadata
Assignees
Labels
No labels