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

Add default locale to all pretty routes #6754

Open
wants to merge 3 commits into
base: 4.x
Choose a base branch
from

Conversation

danut007ro
Copy link
Contributor

This PR is a fix for an issue I'm having in tests with a multilingual app using pretty urls. The issue does not occur when using old urls. My issue is that I had the following error when generating urls in tests using CrudTestUrlGeneration trait

Some mandatory parameters are missing ("_locale") to generate a URL for route "admin_..."

This exception is thrown in UrlGenerator when no locale is found in route defaults, request context or parameters.

When NOT using pretty urls, the _locale is present in route defaults, but when using pretty urls there is no locale.

The PR adds the default _locale for all routes generated by EasyAdmin.

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

Successfully merging this pull request may close these issues.

1 participant