-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[6.x, 8.x] Laravel 8 support PR broke auto method dependency resolving when string keys are used #34903
Comments
Can confirm this issue with routes with string values (like a slug or uuid):
|
@stancl why are you passing arrays with string keys there? |
@stancl @patrickbrouwers do your both use cases work again if we revert this one single change? |
@driesvints reverting that line indeed fixes the routing issue |
@driesvints That way the values get matched with the parameters in Do you want me to try upgrading to the last version and reverting this one change in vendor? |
@stancl yes |
@driesvints Yeah, fixes it completely 👍🏻 |
Wrapping it in $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters))) From my quick test, the livewire component properties resolve, even if the order doesn't match that in the |
@timrspratt How can it work when the order doesn't match and there are no names? Are you using typehints maybe? |
@stancl try it? I think the |
Yeah, that works. |
Fixing and releasing a patch. |
Thanks all |
I don't see how this can be the case. Where in the code does a string key get used? |
That should be fixed, rather than hacking an array_values in. |
@GrahamCampbell this was fixed. See taylor's comment above. |
Fixed with an array_values hack that shouldn't be needed. We need to work out what actually went wrong and fix the underlying issue. |
The method was first using Changing this to directly calling the callback made this incorrect usage more explicit: 82ffe3c#r43417881 Therefor this isn't a bug and calling |
I found what's causing the issue in Livewire. It's because Livewire is explicitly overriding the https://github.com/livewire/livewire/blob/master/src/ImplicitlyBoundMethod.php#L11-L23 I think it's best that Livewire wraps the result of that method in an |
Ping @calebporzio ^ |
Description:
#34884 broke Livewire (and presumably other things too).
Steps To Reproduce:
causes the result of
static::getMethodDependencies($container, $callback, $parameters)
to be['foo' => 'bar']
Which results in:
The text was updated successfully, but these errors were encountered: