Commit ce95b87
committed
bug symfony#52806 [Routing] Fix removing aliases pointing to removed route in
This PR was merged into the 5.4 branch.
Discussion
----------
[Routing] Fix removing aliases pointing to removed route in `RouteCollection::remove()`
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? |
| Issues | symfony#52802
| License | MIT
When a route is removed from the collection, we want to remove all aliases pointing to it. The implementation is flawed because the `$aliases` array is indexed by the alias name, and not by the route since several aliases can point to the same route.
It'll fix the related issue because added FQCN aliases will be correctly removed when `PrefixTrait::addPrefix()` removes the route before reading it for each locale.
Commits
-------
238894b [Routing] Fix removing aliases pointing to removed route in RouteCollection::remove()RouteCollection::remove() (fancyweb)File tree
2 files changed
+11
-2
lines changed- src/Symfony/Component/Routing
- Tests
2 files changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
162 | 169 | | |
163 | 170 | | |
164 | 171 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
| |||
0 commit comments