Skip to content

[Routing] Revert " Fix removing aliases pointing to removed route in RouteCollection::remove()" #52831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

fancyweb
Copy link
Contributor

@fancyweb fancyweb commented Nov 30, 2023

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Issues #52806 (comment)
License MIT

We need to find another solution that doesn't change the behavior on 5.4 😕

@carsonbot carsonbot added this to the 5.4 milestone Nov 30, 2023
@carsonbot carsonbot changed the title Revert "[Routing] Fix removing aliases pointing to removed route in RouteCollection::remove()" [Routing] Revert " Fix removing aliases pointing to removed route in RouteCollection::remove()" Nov 30, 2023
unset($this->aliases[$k]);
}
foreach ((array) $name as $n) {
unset($this->routes[$n], $this->priorities[$n], $this->aliases[$n]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm missing something here, but why not have this method remove both an alias, if it's an alias, or a route with all its aliases, if it's a route?

Copy link
Member

Choose a reason for hiding this comment

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

I also wondered the same. That'd make sense to me.

@mkrauser
Copy link
Contributor

Another thing about this solution:
The Aliases will be removed when the Route itself is removed within the PrefixTrait or HostTrait. But the alias is never re-added.

So when someone uses FQCN for their routing and they add Hosts or Prefixes, that will not work anymore.
Or am I missing something?

@nicolas-grekas
Copy link
Member

Closing in favor of #52845

nicolas-grekas added a commit that referenced this pull request Dec 1, 2023
…ve() (fancyweb)

This PR was merged into the 5.4 branch.

Discussion
----------

[Routing] Restore aliases removal in RouteCollection::remove()

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | #52806 (comment)
| License       | MIT

As suggested in #52831 (comment)

It's still a small behavior change on 5.4, let's see what people think 😃

Commits
-------

3c6dc17 [Routing] Restore aliases removal in RouteCollection::remove()
@fancyweb fancyweb deleted the routing/revert-coll-remove-stuff branch December 1, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants