Currently redhen_dedupe module works only for contacts. Would be good to extend it for organizations as well.
I will try to provide a patch

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

a.milkovsky’s picture

Title: redhen_dedupe for organizations » redhen_dedupe for organizations merging
Assigned: a.milkovsky » Unassigned
Status: Active » Needs review
FileSize
19 KB

I added 2 new menus:

  • "redhen/dedupe/merge/redhen_contact/%" - for contacts merging
  • "redhen/dedupe/merge/redhen_org/%" - for organizations merging

Also I made form callback redhen_dedupe_merge_form() more generic to work with different entity types.

fago’s picture

Status: Needs review » Needs work
+++ b/modules/redhen_dedupe/includes/redhen_dedupe.form.inc
@@ -2,24 +2,33 @@
+    drupal_not_found();
+    drupal_exit();

I think this should better throw an exception as this can happen only when developers use the functon wrong.

Also, it should document which entities this can work with at the function docblock.

a.milkovsky’s picture

I think this should better throw an exception as this can happen only when developers use the functon wrong.

Good catch, thanks. I will change patch tomorrow

Also, it should document which entities this can work with at the function docblock.

Sorry, I didn't get it :)

fago’s picture

Also, it should document which entities this can work with at the function docblock.<?php
The code works only with entities provided by the entity api, i.e. using entity classes - right? So this should be documented then.

a.milkovsky’s picture

Status: Needs work » Needs review
FileSize
20.03 KB

Updated the patch.
I also added new hook that allows modules to act before values merge from records into master record: hook_redhen_dedupe_entity_merge

fago’s picture

Status: Needs review » Reviewed & tested by the community

thanks, changes are good. Also, +1 on adding this hook - we need to allow other related modules to properly respond to a merge. I think it would be cleaner to move all the redhen related modules responding code to their respective modules as well, but that clean-up could happen in a follow-up.

We are using this patch on a client site now, it works fine - thus RTBC.

levelos’s picture

Status: Reviewed & tested by the community » Needs work

Thanks guys, this would be a great addition. Couple of problems. First, the patch doesn't apply cleanly as it's root is full path to the site of the user who authored it rather than the module. More importantly, there is no interface or menu item to access the organizational deduping. redhen/dedupe is just for contacts as it stands. That should be refactored to offer access to dedupe contacts or orgs and then direct to the appropriate deduping form.

a.milkovsky’s picture

Assigned: Unassigned » a.milkovsky

no interface or menu item to access the organizational deduping

There are 2 in the patch:

  1. 'redhen/dedupe/merge/redhen_contact/%'
  2. 'redhen/dedupe/merge/redhen_org/%'

it's root is full path to the site of the user who authored it rather than the module

I will fix that

a.milkovsky’s picture

Assigned: a.milkovsky » Unassigned
Status: Needs work » Needs review
FileSize
20.26 KB

Updated the patch

chertzog’s picture

Has there been any additional work on this?

a.milkovsky’s picture

Actually the patch is finished and ready-to-use. We are using it already in production since 1 year already.
You can review the patch and set it to RTBC, if it works for you.