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

Update Builder.php #20553

Merged
merged 1 commit into from
Aug 14, 2017
Merged

Update Builder.php #20553

merged 1 commit into from
Aug 14, 2017

Conversation

yosef-boaelite
Copy link
Contributor

Fixed $boolean parameter being ignored by "where" function, when the $column parameter is an array.

In detail: the following code should produce a query with "or" conditions:

..->where(["col1"=>"val1","col2"=>"val2"],null,null,"or");

But, it produced the query with "and" conditions - ignoring the last parameter "or" and taking it as "and" (default value)

@taylorotwell taylorotwell merged commit 87a29a2 into laravel:5.4 Aug 14, 2017
@jarnovanleeuwen
Copy link
Contributor

jarnovanleeuwen commented Aug 23, 2017

FYI: This change caused very strange behaviour in our application as some part of a query flipped from a = a or (b = b and c = c) to a = a or (b = b or c = c). Even though this probably was a programming bug on our side, I can imagine this PR can introduce a hard-to-spot bug in many applications and perhaps a test was missing?

@yosef-boaelite
Copy link
Contributor Author

yosef-boaelite commented Aug 23, 2017 via email

@jarnovanleeuwen
Copy link
Contributor

Yeah, your PR is probably correct, but applications that relied on the previous orWhere behaviour might break.

Example:

$query->where(['a' => 'a'])->orWhere(['b' => 'b', 'c' => 'c'])

@yosef-boaelite
Copy link
Contributor Author

yosef-boaelite commented Aug 23, 2017 via email

@jarnovanleeuwen
Copy link
Contributor

jarnovanleeuwen commented Aug 23, 2017 via email

@yosef-boaelite
Copy link
Contributor Author

yosef-boaelite commented Aug 24, 2017 via email

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

Successfully merging this pull request may close these issues.

3 participants