Skip to content

[10.x] Fixed issue: Added a call to the getValue method#48652

Merged
taylorotwell merged 6 commits into
laravel:10.xfrom
lozobojan:add-missing-method-call
Oct 9, 2023
Merged

[10.x] Fixed issue: Added a call to the getValue method#48652
taylorotwell merged 6 commits into
laravel:10.xfrom
lozobojan:add-missing-method-call

Conversation

@lozobojan

Copy link
Copy Markdown
Contributor

Without this, raw SQL queries in conditions throw an exception, since they were rewritten in v10.x.

@taylorotwell

Copy link
Copy Markdown
Member

Please add a simple reproduction example and then mark as ready for review.

@taylorotwell taylorotwell marked this pull request as draft October 9, 2023 14:31
@lozobojan

Copy link
Copy Markdown
Contributor Author

Since v10.x, all the calls like:
... $query->whereRaw(DB::raw("foo = 1")) ... throw an exception, but
... $query->whereRaw("foo = 1") ... work properly.

This adds support for both of the approaches.

@lozobojan lozobojan marked this pull request as ready for review October 9, 2023 16:38
@taylorotwell taylorotwell merged commit 6bfd755 into laravel:10.x Oct 9, 2023
@GrahamCampbell GrahamCampbell changed the title Fixed issue: Added a call to the getValue method [10.x] Fixed issue: Added a call to the getValue method Oct 9, 2023
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 24, 2023
* Fixed issue: Added a call to the getValue method. Without this, raw SQL queries in conditions throw an exception.

* Added check to prevent call on types other than Expression

* Added new test cases for the modified method

* Refactored the variable names

* Fixed a StyleCI issue

* Update Grammar.php

---------

Co-authored-by: Bojan Lozo <bojanlo@maestralsolutions.com>
Co-authored-by: Taylor Otwell <taylor@laravel.com>
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.

2 participants