Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-12928

Merge contacts fatal error: Unknown column 'source_contact_id' in 'where clause (related to activity restructure)

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.0
    • Fix Version/s: 4.4.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      Merge contacts is broken. Clicking Merge Contacts action from Find Contacts throws this fatal error:
      Unknown column 'source_contact_id' in 'where clause

      ------- complete backtrace -------------
      #0 /Users/dgg/git/crm_v4.4/CRM/Core/Error.php(148): CRM_Core_Error::backtrace()
      #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
      #2 /Users/dgg/git/crm_v4.4/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
      #3 /Users/dgg/git/crm_v4.4/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204 ...")
      #4 /Users/dgg/git/crm_v4.4/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204 ...")
      #5 /Users/dgg/git/crm_v4.4/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204 ...", "DB_Error", TRUE)
      #6 /Users/dgg/git/crm_v4.4/packages/DB/mysql.php(898): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'source_contact_id' in 'where clause'")
      #7 /Users/dgg/git/crm_v4.4/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
      #8 /Users/dgg/git/crm_v4.4/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204")
      #9 /Users/dgg/git/crm_v4.4/packages/DB/DataObject.php(2421): DB_common->query("SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204")
      #10 /Users/dgg/git/crm_v4.4/packages/DB/DataObject.php(1613): DB_DataObject->_query("SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204")
      #11 /Users/dgg/git/crm_v4.4/CRM/Core/DAO.php(158): DB_DataObject->query("SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204")
      #12 /Users/dgg/git/crm_v4.4/CRM/Core/DAO.php(947): CRM_Core_DAO->query("SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204", TRUE)
      #13 /Users/dgg/git/crm_v4.4/CRM/Dedupe/Merger.php(177): CRM_Core_DAO::singleValueQuery("SELECT COUNT AS count FROM civicrm_activity WHERE source_contact_id = 204")
      #14 /Users/dgg/git/crm_v4.4/CRM/Dedupe/Merger.php(1005): CRM_Dedupe_Merger::getActiveRelTables("204")
      #15 /Users/dgg/git/crm_v4.4/CRM/Contact/Form/Merge.php(181): CRM_Dedupe_Merger::getRowsElementsAndInfo("50", "204")
      #16 /Users/dgg/git/crm_v4.4/CRM/Core/Form.php(351): CRM_Contact_Form_Merge->preProcess()
      #17 /Users/dgg/git/crm_v4.4/CRM/Core/QuickForm/Action/Display.php(93): CRM_Core_Form->buildForm()
      #18 /Users/dgg/git/crm_v4.4/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Contact_Form_Merge), "display")
      #19 /Users/dgg/git/crm_v4.4/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Merge), "display")
      #20 /Users/dgg/git/crm_v4.4/CRM/Core/Controller.php(315): HTML_QuickForm_Page->handle("display")
      #21 /Users/dgg/git/crm_v4.4/CRM/Utils/Wrapper.php(117): CRM_Core_Controller->run()
      #22 /Users/dgg/git/crm_v4.4/CRM/Core/Invoke.php(266): CRM_Utils_Wrapper->run("CRM_Contact_Form_Merge", "Merge Contact", NULL)
      #23 /Users/dgg/git/crm_v4.4/CRM/Core/Invoke.php(70): CRM_Core_Invoke::runItem((Array:13))
      #24 /Users/dgg/git/crm_v4.4/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
      #25 /Users/dgg/git/crm_v4.4/drupal/civicrm.module(436): CRM_Core_Invoke::invoke((Array:3))
      #26 [internal function](): civicrm_invoke("contact", "merge")
      #27 /Users/dgg/htdocs/drupal7/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
      #28 /Users/dgg/htdocs/drupal7/index.php(21): menu_execute_active_handler()
      #29

      {main}

        Attachments

          Activity

            People

            • Assignee:
              ravish.nair Ravish Nair
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: