Closed loconox closed 4 years ago
Is having both routes enabled really necessary?
That's the default configuration from the UserBundle. In fact, that seems to be a wroking workarround. By redefining each routes and not including sonata_profile_1.xml
I solved my issue.
If fos_user_*
routes are not necessary, it might be a good idea to remove them from sonata routing files ?
Well, I don't know if those fos routes are used in any way, if not, I'm good.
The docs tell you you can safely choose to replace them with the sonata routes, don't they? They don't tell you to keep both.
Well, it says to add this in my routing.yml:
sonata_user_profile:
resource: "@SonataUserBundle/Resources/config/routing/sonata_profile_1.xml"
prefix: /profile
and the file sonata_profile_1.xml
itself contains both routes. That's why I was wondering if there is any reason for this.
Oh wow that's quite weird
Had a look at the routes, the only difference is there name... @Bladrak , can you please explain?
@greg0ire it's been a long time, but I think this might have to do with preserving backwards compatibility at the time. Might not be needed anymore though.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I'm not working on any project using sonata blocks. For me it can be closed.
Environment
Sonata packages
Symfony packages
PHP version
Subject
On the page
/profile
there is a menu rendered from the blocksonata.user.block.menu
. The item 'Dashbord' of this menu should be active because it's the current page.To determine which item of the menu should be active,
KnpMenu
use a Matcher and a collection of voters. For instance, there is aRouteVoter
that should match the current route with the route linked to the menu item, but this doesn't work. In fact, there are two routes that match the uri/profile
, fromSonataUserBundle/Resources/config/routing/sonata_profile_1.xml
, there arefos_user_profile_show
andsonata_user_profile_show
.For a reason I wasn't able to find, in the matcher the current route is
fos_user_profile_show
whereas the item in the menu issonata_user_profile_show
. This way, the menu item is never active.