-
-
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
Multiple dashboards leads to unrewriten URL #6603
Comments
#6580 |
I'm not exactly facing the same issue: On my side, the generated URL are "good" but aren't well rewritten. |
@javiereguiluz I'm afraid this issue is a regression from some recents changes related to pretty urls :( |
What happend if you click on the second dashboard? |
The menu entry links are present, but stay unrewriten as you can see in my latest screenshoot :) |
@javiereguiluz can you take a look at it ? It is blocking upgrades for now since only the first dashboard found has rewriten URLs. Please note that if I use |
check the version 4.20.1 |
Tried it yesterday, bug is still not fixed 😔
…On Sun, 8 Dec 2024, 3:14 pm Ben Hakim, ***@***.***> wrote:
The menu entry links are present, but stay unrewriten as you can see in my
latest screenshoot :)
check the version 4.20.1
—
Reply to this email directly, view it on GitHub
<#6603 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKFGZY2AZTXQZQAWPIJUR32ERH45AVCNFSM6AAAAABSV6G262VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRWGAYTQMRRGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
So we stuck…. |
I don't know if it can helps, but when I empty the cache, on the first refresh only (that rebuild the cache) I get this error:
|
Hello @javiereguiluz , by digging a bit more it seems that this line with multiple dashboard controllers: $dashboardControllerFqcn = $this->get(EA::DASHBOARD_CONTROLLER_FQCN) ?? $context->getRequest()->attributes->get(EA::DASHBOARD_CONTROLLER_FQCN) ?? $this->dashboardControllerRegistry->getFirstDashboardFqcn(); Is unable to find a dashboard fqcn despite dashboard having the right The exception is thrown only when the cache is cold or missing, else no error is thrown but sidebar menu items have unrewriten urls. |
maybe here it's the issue. |
@javiereguiluz pls take a look, we stuck here with no idea what to do. |
The introduction of the pretty URLs has also caused a similar issue I reported here: #6614 |
Thanks you @javiereguiluz ! It was hard to reproduce, but you did it ! |
@javiereguiluz thanks for the dashboard |
This bug fix is now part of the latest stable release: https://github.com/EasyCorp/EasyAdminBundle/releases/tag/v4.20.3 🎉 |
Thank you @javiereguiluz , I was happy to share my app with you and I keep it that way, so you can see a concrete use case of your framework 😺 |
@javiereguiluz there is new bug with it. If I do on the Admin:
the same thing on the Aff/ Or other Dashboard. the same code.
after clicking to one links of the "Aff". it will return to the admin dashboard. the Aff has:
and admin Has:
when I remove the "#[AdminDashboard]" from the aff, everything is working fine on the Aff. |
I also noticed a strange bug: When I'm on a CRUD detail/edit/index page of any entity, if I empty the cache and reload the page I get this error:
This is not happening if I do the same thing on any dashboard pages. |
@Geolim4 can you check on your side. for example I have "admin", "Aff" dashboard. go the "Aff" or anything other then the Admin. use the filter. |
@javiereguiluz the only issue left, it's with the filters. after filters, it will write Admin Dashboard instead of the current Dashboard. |
I found that. when I do:
the issues is gone. |
@javiereguiluz I just upgraded to 4.20.8 and the issue is back again :( |
Rolled back to 4.20.3 and the bug is gone, a regression has been introduced @javiereguiluz :( |
same to me. I really give up with this new urls. |
Javier needs to create very aggressive anti-regression tests for pretty URLs, because there's a lot of regressions and side-effect introduced by patches these last weeks :( |
Maybe create new demo |
Folks, we already have tests with multiple dashboards and they keep passing. I also have one Symfony app with EA and two dashboards and I can't reproduce any issue: all pretty URLs keep working in both dashboards. So, please create a tiny reproducer application that shows the bug and I'll take a look 🙏 Thanks a lot. |
Hello Javier, It's simple: Pretty URL are working in 4.20.3 with multiple dashboard and things changed as of 4.20.4. |
(You still have access to my application for reproducing issues) |
I suspect this commit to be the culprit one: |
@Geolim4 please, try to remove these 3 lines in your app and check if the error is gone: EasyAdminBundle/src/Router/AdminUrlGenerator.php Lines 296 to 298 in 8b52a4d
|
The
It’s happened only if you click on the Dashboard, For example if im in Admin Dashboard, and clicking going to the second dashboard, or clicking of one of the pages |
Hi, same issue as @ben29 on 4.21.1 :/ and works great on 4.20.3 |
any update? |
I try that, I doesn’t help |
Not working :( |
As I have also been having an issue with multiple dashboards I believe it would be good to also check if the adminContext is not null and get the dashboardControllerFqcn from it before defaulting to For me having 3 dashboards (admin = /admin, client = /manage/client, customer = manage/customer) crud links on the client and customer dashboards were always pointing to the routes prefixed with /admin instead of the /manage/xxx routes. This was due to the dashboard index routes not having the default attribute EA::DASHBOARD_CONTROLLER_FQCN set. Setting the index route up like for all dashboards this fixes the links.
However modifying the AdminUrlGenerator removes the need for the route default attribute addition.
Easyadmin 4.23.2 |
@evotodi thanks a lot for investigating this bug. I'm going to try your fix as soon as tomorrow. |
I can open a PR if you'd like |
I have a project with multiples Dasboards:
src/Controller/Admin/DashboardController
![image](https://private-user-images.githubusercontent.com/1332071/390915870-7698a870-1d04-41ab-8ea9-cff254b86d47.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDgxMjAsIm5iZiI6MTczOTQ0NzgyMCwicGF0aCI6Ii8xMzMyMDcxLzM5MDkxNTg3MC03Njk4YTg3MC0xZDA0LTQxYWItOGVhOS1jZmYyNTRiODZkNDcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMTE1NzAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2RmY2UxMDU1OWVjZmZmNWI1NmE3NmRkM2YxOThlZDM2YjA3NmJkYTYzM2NmZTU3MjY0MWM1MzQyZTI5ZmJhMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.YZe_9OcgKzRqMPYSD_sdqOgblJw2XgGwRosV6hzollY)
![image](https://private-user-images.githubusercontent.com/1332071/390917169-05b284ee-f560-4ab3-a6c0-e21731334435.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDgxMjAsIm5iZiI6MTczOTQ0NzgyMCwicGF0aCI6Ii8xMzMyMDcxLzM5MDkxNzE2OS0wNWIyODRlZS1mNTYwLTRhYjMtYTZjMC1lMjE3MzEzMzQ0MzUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTNUMTE1NzAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDU3ZGQ0NWY3ZTM1N2Q4MWU0YmQ5Yzg2NjYxNjUzMjE2ZDM5MGM5MzFjNzAwMzcyMmNhNzhhY2ZlM2FmOWYwOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.8wp8kpwLP_T4Tm9zkG156YQvcj0o12bAlGJZoLeXEcc)
src/Controller/Volunteer/DashboardController
![image](https://private-user-images.githubusercontent.com/1332071/390915819-82aa3ab1-c555-4314-a6a4-93b7ffa5beb1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDgxMjAsIm5iZiI6MTczOTQ0NzgyMCwicGF0aCI6Ii8xMzMyMDcxLzM5MDkxNTgxOS04MmFhM2FiMS1jN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lYzEwMjk3MTkyNzk2NzYzN2UzYzA2NmE4MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.VHH5uGpdEutso7XdKYwqN-8A-SzfkDOUal8Yao6xKX0)
All controllers under Admin/* are successfully rewritten when using
MenuItem::linkToCrud()
However, all the similar controllers under Volunteer/* are not rewritten and the url contain all the CRUD queries.
For a reason I ignore, all the controller under src/Controller/Volunteer/ stay unrewritten, unless if I specify the controller CRUD route directly.
The text was updated successfully, but these errors were encountered: