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
Comment #1
PA robot commentedThere 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.
Comment #2
generalredneckFixed coding standards
Comment #3
chetan-singhal commentedHi 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 "("
--------------------------------------------------------------------------------
Comment #4
generalredneckOK, Looks like http://ventral.org/pareview/httpgitdrupalorgsandboxgeneralredneck1990410git is running clean now.
Thanks cpsighal for checking up on that for me.
Comment #5
Caseledde commentedHi,
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.
Comment #6
Caseledde commentedComment #7
PA robot commentedClosing 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.
Comment #8
generalredneckImplementing fixes form Caseledde
Comment #9
kscheirerNo blocking issues from me.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #10
generalredneckActually 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.
Comment #11
generalredneckAbout 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.
Comment #12
kscheirerIt'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.