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

Calling .debug() breaks countQuery() #86

Open
WacSma opened this issue Oct 7, 2022 · 1 comment
Open

Calling .debug() breaks countQuery() #86

WacSma opened this issue Oct 7, 2022 · 1 comment

Comments

@WacSma
Copy link

WacSma commented Oct 7, 2022

Hi

Thanks for great work!

So here are steps to repro:
new Query('Account').debug().countQuery();

throws:
Error on line 1587, column 1: System.QueryException: unexpected token: ')' Class.Query.countQuery: line 1587, column 1

After removing the debug() call it works fine:
new Query('Account').countQuery();

This is because debug() calls toQueryString() -> formQueryStringPreformat() -> formFieldString(), which does functionFieldList.isEmpty() too early and adds Id to field set.

HenryRLee added a commit that referenced this issue Oct 14, 2022
To solve this issue, copy the field list when performing debug
HenryRLee added a commit that referenced this issue Oct 14, 2022
To solve this issue, copy the field list when performing debug
@HenryRLee
Copy link
Contributor

Thanks for reporting an issue! It's a good catch.

Solved the bug with an additional copy in the debug function.

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

No branches or pull requests

2 participants