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

[5.8] Argument 1 passed to Illuminate\Database\Query\Builder::cleanBindings() must be of the type array, null given #28251

Closed
Cannonb4ll opened this issue Apr 18, 2019 · 4 comments

Comments

Projects
None yet
5 participants
@Cannonb4ll
Copy link
Contributor

commented Apr 18, 2019

  • Laravel Version: 5.8.12
  • PHP Version: 7.2.14
  • Database Driver & Version: MySQL 5.7.20

Description:

Just this morning upgraded from 5.8.11 to 5.8.12 which completely broke my application on the wherePivot part.

Broken:

$variable = $user->books()->wherePivot('owner', true)->findOrFail($id);

Fixed:

$variable = $user->books()->wherePivot('owner', '=', true)->findOrFail($id);

Has this been done intentionally? I cannot find anything regarding this change inside the core update. My code has not changed since the upgrade from 5.8.11 -> 5.8.12

@JeroenBoesten

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

It seems to me like a unintentional change, because it's not regarding every other where statement where it's just assumed that '=' is the operator if no operator is specified. Could this possibly be related to the changes made to the where here: #28192

@ankurk91

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

Lucky i am using withPivotValue() method which internally uses

$this->wherePivot($column, '=', $value)
@Cannonb4ll

This comment has been minimized.

Copy link
Contributor Author

commented Apr 18, 2019

@ankurk91 I fail to see how this is contributing to this core issue.

@ahinkle

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

Hey, the original PR was reverted (04a547e) and was released in 5.8.13. This issue is now solved. An additional test has been submitted to prevent future issues. #28260

@driesvints driesvints closed this Apr 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.