[Routing] Route parameter aliases breaks automatic entity fetching #60637
Labels
Content-Length: 224431 | pFad | http://github.com/symfony/symfony/issues/60637
BEFetched URL: http://github.com/symfony/symfony/issues/60637
Alternative Proxies:
Symfony version(s) affected
7.4.0
Description
I'm currently using "route parameter mapping" within a controller that handles CRUD for an entity that represents a join table in a many-to-many relationship, very similar in setup to the QuestionTag entity described in this symfony cast: https://symfonycasts.com/screencast/doctrine-relations/complex-many-to-many.
As it's currently set up in 7.3.x, I'm able to have a create method automatically get the first entity in the relationship, I'm also able to have other methods such as an update method automatically get the join entity via the two params in the route.
In 7.4.0, this has changed and I'm no longer able to perform a create operation.
How to reproduce
My logic is something like the following
What I've found in parameter bag when attempting the create
Possible Solution
Move the upper most route inside each method route and rename the parameter mapping removing the need for MapEntity in this case.
It does bring
#[MapEntity(id: ...)]
into question however and therefore this is not a real solution to the problemAdditional Context
No response
The text was updated successfully, but these errors were encountered: