Problem/Motivation

I just pulled in the latest 8.x-3.x work and it appears support for "IN" conditions is broken. Instead of results I get MALFORMED_QUERY back from Salesforce. I think we had a breaking change with the SelectQuery API come in recently.

Proposed resolution

Escape the values in the IN condition's value array before transforming to a string, not after.

Remaining tasks

- Determine cause
- Patch
- Review

User interface changes

None.

API changes

IN conditions work once again.

Data model changes

None.

Release notes snippet

TBD.

Comments

chrisolof created an issue. See original summary.

chrisolof’s picture

So instead of this:

SF_FIELD_NAME+IN+('VALUE1','VALUE2')

We now have this:

SF_FIELD_NAME+IN+'(%5C'VALUE1%5C',%5C'VALUE2%5C')'

Decoded it looks like this:

SF_FIELD_NAME IN '(\'VALUE1\',\'VALUE2\')'

It appears the new escaping happens after the IN array is converted to a string ('VALUE1','VALUE2'). The result is a malformed query. Patch on the way.

chrisolof’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.4 KB

Patch attached. Ready for review.

chrisolof’s picture

Personally I'd be in favor of the approach in #3027875-6: escapeSoqlValue not handling all strings correctly., which is simply removing this problematic single-quote escaping code.

aaronbauman’s picture

Status: Needs review » Closed (duplicate)