Skip to content

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