Commit 206351d
committed
bug #62325 [Routing] Fix default value not taken if usigng name:entity.attribute (eltharin)
This PR was squashed before being merged into the 7.3 branch.
Discussion
----------
[Routing] Fix default value not taken if usigng name:entity.attribute
| 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 :
```php
#[Route('/zoom/{vortexLibelle:vortex.libelle}/{libelle:otherVortex}', name: 'zoom', methods: ['GET'])]
#[AjaxCallOrNot]
public function zoom(VortexManager $vr, Vortex $vortex, ?Vortex $otherVortex = null): Response
{
...
}
```
or
```php
#[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
Commits
-------
f7c898f [Routing] Fix default value not taken if usigng name:entity.attributeFile tree
3 files changed
+19
-4
lines changed- src/Symfony/Component/Routing
- Loader
- Tests
- Fixtures/AttributeFixtures
- Loader
3 files changed
+19
-4
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
33 | 44 | | |
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
0 commit comments