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

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

Merged
merged 6 commits into from Oct 9, 2023

Conversation

lozobojan
Copy link
Contributor

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

@taylorotwell
Copy link
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
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
20 checks passed
@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.

None yet

2 participants