In this patch, 2 different "pull allowed" hooks to address different pull use cases:

1. hook_salesforce_pull_record_allowed:
Prevent a Salesforce object from being added to the pull queue. For example, prevent pull of Contacts without email address.

2. hook_salesforce_pull_entity_allowed
Skip processing of a Salesforce pull queue item. For example, never pull to user 1.

Comments

ohthehugemanatee’s picture

kenorb’s picture

Status: Needs review » Needs work
Related issues: +#2186153: Provide additional Salesforce push/pull hooks for pre_export changes.

This doesn't look right:

if ($process = TRUE) { 
aaronbauman’s picture

Status: Needs work » Postponed

Marking postponed on #2186153: Provide additional Salesforce push/pull hooks for pre_export changes.
If that gets closed without a similar patch, this can get re-opened.

OK, scratch that.
Marking 2186153 as "won't fix", and working on a re-roll of this patch to address the use case.

aaronbauman’s picture

Title: Add a hook so users can process or abort a record before it hits the queue » Add "pull allowed" hooks
Issue summary: View changes
Status: Postponed » Needs review
StatusFileSize
new4.75 KB
labboy0276’s picture

Status: Needs review » Reviewed & tested by the community

Tested patch in #4, it works great, thanks!

aaronbauman’s picture

Status: Reviewed & tested by the community » Postponed
Related issues: +#2688033: Add entity_presave/insert/update sf pull hooks

I think this needs to be combined with / subsumed by the proposed fix in #2688033: Add entity_presave/insert/update sf pull hooks

labboy0276’s picture

Even better

wxactly’s picture

StatusFileSize
new4.81 KB

Re-rolling this patch for compatibility with 7.x-3.2.

mariacha1’s picture

Status: Postponed » Needs work

The issue this was originally trying to solve -- preventing items from syncing based on some custom logic -- is technically fulfilled by #2688033: Add entity_presave/insert/update sf pull hooks but that method not only stops the sync but also throws a watchdog error. This leads to a lot of generally uninteresting and unimportant warnings in your logs. There is probably a better way to solve both problems. At the very least, I'd like this code to be more DRY. Put that copy/pasta in a function, yo!

vaish’s picture

Status: Needs work » Needs review
StatusFileSize
new6.02 KB
new6.45 KB

Patch from #8 updated to make code more DRY.

ruscoe’s picture

Rerolled patch from #10 against current 7.x-3.x-dev branch.

bdone’s picture

another reroll. this one for #11 @ 7.x-3.x; adding minor coding standard fixes for "Doc comment short description must be on a single line, further text should be a separate paragraph", and ignoring type hinting.

bdone’s picture

this a reroll of #12, but specifically for the 7.x-3.2 tag. please ignore for 7.x-3.x-dev.

bdone’s picture

aaronbauman’s picture

Component: Code » salesforce.module
Status: Needs review » 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.