Skip to content

Conversation

@eltharin
Copy link
Contributor

@eltharin eltharin commented Nov 6, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

When using Mapped parameters, default values can't be used :

 #[Route('/zoom/{vortexLibelle:vortex.libelle}/{libelle:otherVortex}', name: 'zoom', methods: ['GET'])] #[AjaxCallOrNot] public function zoom(VortexManager $vr, Vortex $vortex, ?Vortex $otherVortex = null): Response { ... }

or

 #[Route('/zoom/{vortexLibelle:vortex.libelle}/{otherVortexLibelle:otherVortex.libelle}', name: 'zoom', methods: ['GET'])] #[AjaxCallOrNot] public function zoom(VortexManager $vr, Vortex $vortex, ?Vortex $otherVortex = null): Response { ... }

route was not found if we want to go to : /zoom/myVortex,

with this fix, it's OK

@carsonbot carsonbot added this to the 7.3 milestone Nov 6, 2025
@carsonbot carsonbot changed the title correct bug for default value not taken if usigng name:entity.attribute correct bug for default value not taken if usigng name:entity.attribute Nov 6, 2025
@xabbuh xabbuh added the Routing label Nov 6, 2025
@carsonbot carsonbot changed the title correct bug for default value not taken if usigng name:entity.attribute [Routing] correct bug for default value not taken if usigng name:entity.attribute Nov 6, 2025
@eltharin eltharin changed the title [Routing] correct bug for default value not taken if usigng name:entity.attribute [Routing] Fix default value not taken if usigng name:entity.attribute Nov 6, 2025
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the logic for backed enums in the previous block? don't we need something similar?

@eltharin eltharin force-pushed the error_default_route_argument_with_complete_notation branch from 6a89ac7 to f5077aa Compare November 6, 2025 16:28
@eltharin
Copy link
Contributor Author

eltharin commented Nov 6, 2025

I write on my todolist to allow mapped parameters notation to use BackedEnum::from :)

@eltharin eltharin force-pushed the error_default_route_argument_with_complete_notation branch from a916fc7 to 613acce Compare November 6, 2025 16:43
@nicolas-grekas nicolas-grekas force-pushed the error_default_route_argument_with_complete_notation branch from 613acce to f7c898f Compare November 12, 2025 16:36
@nicolas-grekas
Copy link
Member

Thank you @eltharin.

@nicolas-grekas nicolas-grekas merged commit 206351d into symfony:7.3 Nov 12, 2025
9 checks passed
This was referenced Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment