From 4cc10497ba949bdce72e3e0b70a015d6363e2ae2 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 18 Oct 2013 15:40:37 +0530 Subject: [PATCH] CRM-13344 fix - Resolve test / schema issues around prefix_id, suffix_id, gender http://issues.civicrm.org/jira/browse/CRM-13344 --- CRM/Contact/Import/Parser/Contact.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 6852c3d35e..d1c86746db 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -662,7 +662,8 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { //fixed CRM-4148 //now we create new contact in update/fill mode also. - if ($createNewContact) { + $contactID = NULL; + if ($createNewContact || $this->_updateWithId) { //CRM-4430, don't carry if not submitted. foreach (array('prefix_id', 'suffix_id', 'gender_id') as $name) { @@ -673,10 +674,12 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } } } - $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, NULL, TRUE, $this->_dedupeRuleGroupID); + if ($this->_updateWithId && !empty($params['id'])) { + $contactID = $params['id']; + } + $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactID, TRUE, $this->_dedupeRuleGroupID); } - $contactID = NULL; if (isset($newContact) && is_object($newContact) && ($newContact instanceof CRM_Contact_BAO_Contact)) { $relationship = TRUE; $newContact = clone($newContact); -- 2.25.1