hook_salesforce_query_alter only provides one parameter - the SalesforceSelectQuery $query. Often you need to know which mapping the query applies to in order to alter the query effectively.

Comments

wxactly created an issue. See original summary.

wxactly’s picture

Patch moves the salesforce_query alter invocation out of the Salesforce class, and passes the mapping object to hook implementations.

hook_salesforce_query_alter(SalesforceSelectQuery &$query, $mapping)

aaronbauman’s picture

yup, +1 for this.

wxactly’s picture

Status: Needs review » Needs work

Argh - going to have to rethink this. If you have multiple mappings for the same salesforce object, the module scoops them all up into one query and the patch in #2 only passes the last mapping object in the loop. That makes the patch fairly buggy for the use case I was hoping it would work for.

antiorario’s picture

Is there any progress on this? If the issue needs more hands, I could perhaps think about it.

aaronbauman’s picture

Status: Needs work » Closed (won't fix)

7.x is no longer supported

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.