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

PrettyUrl => entityId is not passed to the views #6535

Closed
stefy31 opened this issue Nov 13, 2024 · 5 comments
Closed

PrettyUrl => entityId is not passed to the views #6535

stefy31 opened this issue Nov 13, 2024 · 5 comments

Comments

@stefy31
Copy link

stefy31 commented Nov 13, 2024

Describe the bug
I updated the version of my easyadmin to the version 4.14, to benefit from the new functionality of prettyUrl. This caused an error in the views, which no longer retrieve the value of the entityId variable.
I reinstalled symfony and easyadmin from 0, hoping to resolve the problem, but the bug is still present.

Inside the crudController, if i do: 'dd($context->getRequest());'
i can see that the line query/parameters is empty .
Variables entityId, crudAction and crudControllerFqcn are missing.

I don't know if i missed something, if it's a bug, or if the documentation is not complete enough.
Thanks for your help.

To Reproduce
EasyAdmin 4.14
Activate the prettyUrl: create file "config/routes/easyadmin.yaml"
with content:
"# config/routes/easyadmin.yaml
easyadmin:
resource: .
type: easyadmin.routes
"

Verify that routes have changed and are ok.

Go to an edit form =>
ERROR:

"
An exception has been thrown during the rendering of a template ("Some mandatory parameters are missing ("entityId") to generate a URL for route "app_admin_user_edit".").

in C:\xampp\htdocs\falcon2\vendor\easycorp\easyadmin-bundle\src\Resources\views\menu.html.twig (line 7)

{% for menuItem in ea.mainMenu.items %}
"

(OPTIONAL) Additional context
bugPrettyUrl
bugPrettyUrl02
bugPrettyUrl03

@thomas-pike
Copy link

This is likely issue #6523. You can check by commenting out any MenuItem::linkToDashboard in your dashboard's configureMenuItems() and see if the views now load correctly.

@stefy31
Copy link
Author

stefy31 commented Nov 15, 2024

Thanks, commenting the line " #MenuItem::linkToDashboard('Dashboard', 'fa fa-home'), " from my DashboardController resolve the problem.
I hope the bug will be corrected soon, thank you very much for your help

@lochmueller
Copy link

Hmm... i my case, comment out yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home'); do not solve the problem (current version of easy admin) :-/ Perhaps the UUID identifiers are the problem in my case?!

@javiereguiluz javiereguiluz added this to the 4.x milestone Nov 25, 2024
javiereguiluz added a commit that referenced this issue Nov 25, 2024
This PR was squashed before being merged into the 4.x branch.

Discussion
----------

Fix an edge-case when using pretty URLs

This is an alternative to #6553.

Fixes #6550, #6535, #6498.

`@alexislefebvre` thanks a lot for contributing that PR and also, thanks a lot for the failing test reproducer in #6559, which helped me a lot.

Commits
-------

eaa6a5b Fix an edge-case when using pretty URLs
@javiereguiluz
Copy link
Collaborator

Closing as fixed in #6567 and available since version 4.16.1.

@alexislefebvre
Copy link
Contributor

Closing as fixed in #6567 and available since version 4.16.1.

Thanks! It works in my project, I removed the workaround.

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

No branches or pull requests

5 participants