From: Pradeep Dorugade Date: Tue, 16 Apr 2013 12:59:19 +0000 (+0530) Subject: -- fixed for CRM-12333 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d8e9fe867809c9c363e2d4da67c3b8d981e741e3;p=civicrm-core.git -- fixed for CRM-12333 --- diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index b9634bbd23..cebe14fc2d 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -714,13 +714,6 @@ LEFT JOIN civicrm_email ce ON ce.id = clb.email_id ; ' ; $dao = CRM_Core_DAO::executeQuery($query); while($dao->fetch()) { - $params = array( - 'sort_name' => $dao->name, - 'display_name' => $dao->name, - 'legal_name' => $dao->name, - 'organization_name' => $dao->name, - 'contact_type' => 'Organization' - ); $query = " SELECT cc.id FROM civicrm_contact cc LEFT JOIN civicrm_email ce ON ce.contact_id = cc.id @@ -734,6 +727,13 @@ WHERE cc.contact_type = 'Organization' AND cc.organization_name = %1 $contactID = CRM_Core_DAO::singleValueQuery($query, $params); $context[1] = $dao->name; if (empty($contactID)) { + $params = array( + 'sort_name' => $dao->name, + 'display_name' => $dao->name, + 'legal_name' => $dao->name, + 'organization_name' => $dao->name, + 'contact_type' => 'Organization' + ); $contact = CRM_Contact_BAO_Contact::add($params); $contactID = $contact->id; $context[0] = 'added';