-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Pretty URLs are not used when relying on MenuItem::linkToCrud
and @EasyAdmin/page/content.html.twig
#6499
Comments
I've set up tests in my fork to ensure it is reproducible: quentint@268e336. |
Hi there, I have noticed the same, and tracked it down to the following:
Hope this helps. The pretty URLs are very.. pretty 🥰 |
First: I love the new Pretty URLs. Adding to the Posts before: I could narrow it down to the Template Building the navigation, it seems the entityId is missing to generate the URLs. |
Pretty URLS, unfortunately, seem to have just not been implemented or tested properly prior to release. Although I can see all my |
Quoi qu’il en soit, quelle mission honorable. tant d'utilisateurs se sont plaints de l'absence de jolies URL - le but est le chemin ! bravo au vieux monde |
@javiereguiluz just upgraded to 4.14.2 and now I get the error:
when trying to render my dashboard template, even if I scale that template right back down to
According to the debug trace, the error is thrown on the last line I've included here:
|
Hi @dwgebler, it seems to be linked to |
@JorickPepin you're correct, removing |
@dwgebler yes, sorry about this. I'm going to try to fix that soon. Meanwhile, and I'm very sorry, disable the pretty URLs feature, and you'll be able to use it very soon. Thanks! |
@javiereguiluz really appreciate the work you've put in for pretty URLs, thank you. |
We're constantly releasing new versions to fix reported bugs related to pretty URLS: https://github.com/EasyCorp/EasyAdminBundle/releases Please, update to the latest version and report if you still face the same errors. Thanks. |
We've just released a new issue (the third in the last 24 hours) to fix more issues. Please, try it and report bugs creating new issues. Thanks! |
Describe the bug
I was trying the new pretty URLs feature and activated them by adding the
easyadmin.yaml
config. I noticed the routes where created perfectly but were not used in my backend.Looking around, I noticed if I opened one of them directly, without clicking on the menu items links (that were using the old/query string links), the page would load and the menu links would use the new/pretty URLs. At first I thought I had to replace all my
MenuItem::linkToCrud
calls withMenuItem::linkToUrl
but the docs didn't say anything about that, so I dug a bit more. It turns out, when relying on the@EasyAdmin/page/content.html.twig
view for the dashboard'sindex
, the generated routes do not have theROUTE_CREATED_BY_EASYADMIN
option, and fall back to the old URLs.Unfortunately, the tests pass because the
index
methods on bothtests/PrettyUrlsTestApplication/src/Controller/DashboardController.php
andtests/PrettyUrlsTestApplication/src/Controller/SecondDashboardController.php
rely onAbstractDashboardController
's index method, which uses@EasyAdmin/welcome.html.twig
that does not contain any menu items (so no test checks if the URLs are pretty in this case).To Reproduce
Make sure to rely on the base
@EasyAdmin/page/content.html.twig
view in your dashboard'sindex
method.The text was updated successfully, but these errors were encountered: