Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locales in combination with pretty urls not working #6619

Open
dahormez opened this issue Dec 4, 2024 · 0 comments
Open

Locales in combination with pretty urls not working #6619

dahormez opened this issue Dec 4, 2024 · 0 comments

Comments

@dahormez
Copy link

dahormez commented Dec 4, 2024

Describe the bug
Locales in combination with pretty urls not working. Tested in v4.14.0 - v4.19.0

To Reproduce

Setup:

#[Route('/admin/{_locale}', name: 'admin', defaults: ['_locale' => 'de'])]
public function index(): Response
{
    return $this->render('admin/page/dashboard.html.twig');
}

public function configureDashboard(): Dashboard
{
    return Dashboard::new()
        ->setTitle('Administration')
        ->setLocales(['de', 'en']);
}

Add new crud:

public function configureMenuItems(): iterable
{
    return [
        yield MenuItem::linkToCrud('Users', 'fa fa-user', UserCrudController::getEntityFqcn()),
    ];
}

Try to edit any entry produces:
An exception has been thrown during the rendering of a template ("Some mandatory parameters are missing ("entityId") to generate a URL for route "admin_user_edit".").

Error appears in:
vendor/easycorp/easyadmin-bundle/templates/layout.html.twig:133

Here is entityId not set:
{{ ea_url().set('_locale', localeDto.locale) }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant