hook_crowd_presync_user_data() is used to implement any local sync tasks that may be needed before native syncs take place. A common thing to do there is to make custom changes to the local user object based on crowd data (populate local first/last name fields, etc.). Though the account object is available in this hook, it's best not to alter that directly, so current best practice is to call user_save() directly as part of the hook. This is fine, but it seems a little redundant given that user_save() is called by the module almost immediately after hook_crowd_presync_user_data() is invoked. A better way would be to expose an $edit variable in the hook, and then carry that through to the sequential user_save() that follows. This would make the hook a bit more flexible and performant.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjacobs created an issue. See original summary.

rjacobs’s picture

Status: Active » Needs review
FileSize
2.72 KB

Here we go.

  • rjacobs committed 336dead on 7.x-2.x
    Issue #2653110 by rjacobs: Pass an $edit variable in...
rjacobs’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.