Skip to content
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

DeferrableProvider causes config to not be loaded #677

Closed
owenconti opened this issue Oct 22, 2021 · 3 comments
Closed

DeferrableProvider causes config to not be loaded #677

owenconti opened this issue Oct 22, 2021 · 3 comments
Assignees

Comments

@owenconti
Copy link

Hello, I believe this commit that introduced the DeferrableProvider is causing the non-published config file from being loaded: #660

This causes an issue in QueryBuilderRequest where all input data is returned instead of just the filter= values, because filterParameterName ends up being null: https://github.com/spatie/laravel-query-builder/blob/master/src/QueryBuilderRequest.php#L93

So far our fix is to just publish our own copy of the config file, but ideally users should not have to do that. I think using the DeferrableProvider may not be applicable for this package, since it does more than just register bindings: https://laravel.com/docs/8.x/providers#deferred-providers

Thanks for your time

@jonnywilliamson
Copy link

jonnywilliamson commented Oct 27, 2021

Just having the exact same issue. Unless I publish the config file, then the query builder breaks as it can't find the config values when trying to get the names for sort filter etc.

Thank you

[Quick fix is indeed to publish the config file, although in my case I don't really have any need to do so]

@AlexVanderbist
Copy link
Member

Ah, that's not great. Thanks for bringing this to our attention. Looks like it slipped past the tests because of the way Testbench is set up...

Tagged a fix in 4.0.1

@jonnywilliamson
Copy link

Amazing response time!

Reported and fixed and new release inside 6 minutes! Insane! 😆

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants