Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[6.x] Fix routing bug that causes missing parameters to be ignored #30659
I noticed there's a bug with creating a URL. When there's a named parameter that's not in the route, it gets added to the query string. But when there's no other parameters, the missing parameter gets ignored.
For example, I had a route similar to this:
When using it like this:
route('test-route', ['foo' => 'bar'])
Previously this would be the result:
With this route - with a required parameter:
How can both this:
route('test-route') // error
route('test-route', ['unrelated-parameter' => 123]) // /foo//test?unrelated-parameter=123
Both be the expected behaviour? Is the intention to enforce or not to enforce required parameters?