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

Crash if 'where' query parameter is an array #3

Closed
ebernie opened this issue Dec 20, 2016 · 2 comments
Closed

Crash if 'where' query parameter is an array #3

ebernie opened this issue Dec 20, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@ebernie
Copy link

ebernie commented Dec 20, 2016

SomeModel::where(['status' => 'show'])->get();

Running the above query will trigger a crash

Argument 1 passed to App\Helpers\ModelCache\QueryCacheBuilder::__construct() must be an instance of App\Helpers\ModelCache\QueryCache, instance of Illuminate\Database\MySqlConnection given, called in /Users/ebernie/dev/php/ricebowl/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php on line 1942 and defined

Overriding newQuery in QueryCacheBuilder seems to make it go away.

public function newQuery() 
{
    return new static($this->cache, $this->connection, $this->grammar, $this->processor);
}
@ebernie ebernie changed the title Crash if where query parameter is an array Crash if 'where' query parameter is an array Dec 20, 2016
@SimplyCorey
Copy link
Member

Thanks. I'll get a fix out for both of these issues tonight.

@SimplyCorey SimplyCorey self-assigned this Dec 20, 2016
@SimplyCorey SimplyCorey added this to the 1.0 milestone Dec 20, 2016
@SimplyCorey
Copy link
Member

@ebernie Just finished everything up and pushed out 1.0.0. Let me know if you have any issues.

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

No branches or pull requests

2 participants