2

Drupal 7, Civicrm 4.7.4

I'm getting this error message after every contact merge. Any ideas?


debug message

CiviCRM_API3_Exception: "Invalid Contact Id"

 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Dedupe/Merger.php(1945): civicrm_api3("activity", "create", (Array:5))
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Dedupe/Merger.php(1834): CRM_Dedupe_Merger::createMergeActivities("55836", "197792")
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Contact/Form/Merge.php(318): CRM_Dedupe_Merger::moveAllBelongings("55836", "197792", (Array:35))
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Form.php(423): CRM_Contact_Form_Merge->postProcess()
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Contact_Form_Merge), "next", "Next")
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contact_Form_Merge), "next")
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Merge), "next")
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(286): CRM_Utils_Wrapper->run("CRM_Contact_Form_Merge", "Merge Contact", NULL)
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
 /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/drupal/civicrm.module(454): CRM_Core_Invoke::invoke((Array:3))
 [internal function](): civicrm_invoke("contact", "merge")
 /var/www/vhosts/example.com/httpdocs/includes/menu.inc(527): call_user_func_array("civicrm_invoke", (Array:2))
 /var/www/vhosts/example.com/httpdocs/index.php(21): menu_execute_active_handler()
 {main}
 Sorry but we are not able to provide this at the moment.
Invalid Contact Id
3

Ah - if the contact id doesn't exist perhaps delete to trash is off?

| improve this answer | |
  • We have a winner. Setting "Contact Trash and Undelete" in Administer > Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.) fixes this behavior. – Cullen McGough Mar 25 '16 at 20:39
1

This is happening as a result of CRM-18106, "Add activity to deleted contacts showing they were deleted by merge". I added a comment to that issue referencing this question. In short: In Civi 4.7.4, this activity is added to contacts deleted by merge - part of a larger effort to make deduping reversible. It's not working for you. That's unfortunate - but the good news is that what's broken didn't exist before 4.7.4, so you shouldn't be experiencing any ill effects other than the error.

| improve this answer | |
1

This is now logged with a patch here https://issues.civicrm.org/jira/browse/CRM-18307

However if you are experiencing this I suggest you give serious consideration to enabling 'Contact Trash and Undelete' per Cullen McGough Mar 25 at 20:39 - since that setting is the default and for most sites having the delete to trash option turned on is a sensible precaution

| improve this answer | |
-1

shot in the dark... any external ID's?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.