http://drupal.org/sandbox/generalredneck/1990410
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/generalredneck/1990410.git

This module hooks into User Merge to add support for merging user information related to CiviCRM's user integration. This includes the contact connected to the user and all the information the contact owns.

By hooking in to the User Merge interface, we can figure out what contacts need to be merged together using the UF Match record. Normal use of the User Merge Module has not changed at all.

After we find out the two contacts, we treat them as duplicate contacts, sending them through the same process you would go through if an Administrator was trying to merge two contacts. The only difference here is you do not get to choose which information to keep.

The information is merged "Agressively". That means no rules, just merge. This favors the user-to-keep's contact information unless it's empty. However, the related information (memberships, groups, activity, etc...) the user-to-delete owns will be unioned with the information that the user-to-keep owns. Many batch dedup scripts are written to follow this same pattern.

In the case that the user-to-delete doesn't have a CiviCRM contact entry, User Merge continues on as if this module wasn't there.

In the case that the user-to-keep doesn't have a CiviCRM contact entry, but the user-to-delete does, the contact changes ownership with no union of information.

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxgeneralredneck1990410git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

generalredneck’s picture

Status: Needs work » Needs review

Fixed coding standards

chetan-singhal’s picture

Status: Needs review » Needs work

Hi generalredneck

There are few error also remaining
--------------------------------------------------------------------------------
FOUND 3 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
15 | ERROR | There should be no white space after an opening "("
37 | ERROR | No space found after comma in function call
37 | ERROR | There should be no white space after an opening "("
--------------------------------------------------------------------------------

generalredneck’s picture

Status: Needs work » Needs review

OK, Looks like http://ventral.org/pareview/httpgitdrupalorgsandboxgeneralredneck1990410git is running clean now.

Thanks cpsighal for checking up on that for me.

Caseledde’s picture

Hi,

I found some issues:

1) watch_dog()
If you want drupal to log your error message, use watchdog(). (not watch_dog())

2) Unused variables
There a two unused variables: $dao line 55 and $result line 76. Maybe you should check the return values to log errors or delete those variables.

Caseledde’s picture

Status: Needs review » Needs work
PA robot’s picture

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

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

I'm a robot and this is an automated message from Project Applications Scraper.

generalredneck’s picture

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

Implementing fixes form Caseledde

kscheirer’s picture

Status: Needs review » Reviewed & tested by the community
  • There's a new User Merge 7.x-1.x-dev as of a few days ago, can you retest? Consider asking the maintainer of that module to release a 1.0 version, so that you can have a fixed dependency.
  • I wasn't quite sure which one was user-to-keep and which user-to-delete based on the project page, but that might be my unfamiliarity with CRMs in general. I would guess that the Drupal user is the one-to-keep?
  • The code is definitely short, but I think integrating two APIs in a useful module outweighs that concern.

No blocking issues from me.

----
Top Shelf Modules - Crafted, Curated, Contributed.

generalredneck’s picture

Actually im that maintainer as of earlier this week. 1.0 is definatly a task that I have in the issue queue. All the work in dev is work ive put in there. Luckly there are no api Changes as of yet.

Thanks for the review.

generalredneck’s picture

About user to delete vs keep. That is drupal specific. The idea is a interface where 2 users are in reality the same person. So in this case we want to merge the 2 accounts. The user to keep is the account we are merging data into from the user to delete. In this case we also have Civicrm data linked to those 2 user accounts we need to factor in... thus my Module. Greggles usermerge module (that I am now comaintainer of) was only built to do core user stuff with an api to extend for this very reason.

kscheirer’s picture

Status: Reviewed & tested by the community » Fixed

It's been a month without any problems reported, so I'm promoting this myself as per https://drupal.org/node/1125818.

Thanks for your contribution, generalredneck!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

----
Top Shelf Modules - Crafted, Curated, Contributed.

Status: Fixed » Closed (fixed)

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