CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Merge and Current Emplpoyer
Pages: [1]

Author Topic: Merge and Current Emplpoyer  (Read 636 times)

civicrmsav

  • I post frequently
  • ***
  • Posts: 121
  • Karma: 5
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 7.x
Merge and Current Emplpoyer
April 11, 2013, 11:41:38 am
When you merge organization contacts, if they have individuals who are their current employees, the current employee field does not update correctly.  I just verified this on the 4.3 demo site.

This seems to be related to this issue http://forum.civicrm.org/index.php/topic,13555.msg58057.html#msg58057 which was fixed back in 3.2
(http://issues.civicrm.org/jira/browse/CRM-6184)

Here's the test case:

Create an Organization Record called "Test 1"
Create an individual Record "Mark Smith" current employer "Test 1"

Create another Organizational Contact "Test 2"
Create another individual record "Mark Johnson" current employer "Test 2"

Now use the deduplication feature to merge "Test 1" and "Test 2"  keeping "Test 1" as the existing contact and merging "Test 2" out of existence.

Look at the record for Mark Johnson.  You will be surprised to see his "current employer" is "Test 2", which does not exist in the database any more.  However, clicking on the highlighted link for "Test 2" actually takes you to the record for "Test 1".  I've left the test as is on demo if anyone wants to see this result.  http://drupal.demo.civicrm.org/civicrm/contact/view?reset=1&cid=125


(I haven't had time to verify yet on demo, but this came to my attention because we have organizational memberships with benefits flowing to indivudals who are employees and individuals who become employees of a member by means of a merge are not getting the appropriate membership.    I'm hoping if we resolve this issue it will cause the membership's to resolve correctly after a merge as well.)


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Merge and Current Emplpoyer
April 11, 2013, 02:36:59 pm

seems like while we do merge the ids, we dont update the organization name in the respective contact records

can you take a look at the merge code and contribute a patch for this

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

civicrmsav

  • I post frequently
  • ***
  • Posts: 121
  • Karma: 5
  • CiviCRM version: 4.2.6
  • CMS version: Drupal 7.x
Re: Merge and Current Emplpoyer
April 12, 2013, 10:41:03 am
I can see where to update the organization_name. That's pretty straightforward if I just force the sql statement.  But that wouldn't solve the  issue of memberships not being granted withdrawn properly based on the current employer relationship. 

I think that instead I'd need to find all the employees of the employer being merged out of existence and then loop through them running CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($employeeid,$mainId);   

Would that cause the memberships to be adjusted properly, or is there something else I need to?


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Merge and Current Emplpoyer

This forum was archived on 2017-11-26.