-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
Unexpected behavior of getFormattedQuery() #3534
Comments
Fixing this might require quite deep refactoring of how the QB works, as we would need to cache the calls and evaluate everything later, right now there is no easy way to reset things to "before finalization" state. But in the long run it would make sense for sure, cloning would be much simpler too. |
Maybe a warning could be added to the documentation until this gets fixed? |
We could probably throw if you try to modify a finalized QB, adding notes to docs wont help much, it would be still quite hidden. |
I think that would be a good Idea, you really shouldn't be able to modify a finalized query. |
Calling getFormattedQuery() after a join with pagination, causes subsequent QueryBuilder calls to insert SQL Statements in the wrong location.
I have included a minimal Example. Both qb and qb2 should build the same query, hover the getFormattedQuery() call modifies the result.
The DISABLE_PAGINATE flag can be used as a workaround, however I expect a getter function to not modify the underlying object.
Testcase
The text was updated successfully, but these errors were encountered: