Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-07-14-13-42-39
authorkurund <kurund@civicrm.org>
Mon, 14 Jul 2014 09:29:02 +0000 (14:59 +0530)
committerkurund <kurund@civicrm.org>
Mon, 14 Jul 2014 09:29:02 +0000 (14:59 +0530)
Conflicts:
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Contact/Utils.php

1  2 
CRM/Contact/BAO/Contact.php
CRM/Contact/Selector.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/MembershipTest.php

index 54fe7206ce99869dc7f2b2261f643a2c4d4b1e9b,07f9ae2c0e932d147d45fb34dde014110985b9db..f545f04b7863fa18b4d3873053cef5ca3c2c52b1
@@@ -233,14 -223,19 +233,15 @@@ class CRM_Contact_BAO_Contact extends C
        );
      }
  
 -    if ($contact->contact_type == 'Individual' &&
 -      (isset($params['current_employer']) ||
 -      isset($params['employer_id'])
 -    )
 -    ) {
 +    if ($contact->contact_type == 'Individual' && (isset($params['current_employer']) || isset($params['employer_id']))) {
-       $newEmployer = !empty($params['employer_id']) ? $params['employer_id'] : CRM_Utils_Array::value('current_employer', $params);
        // create current employer
+       $newEmployer = !empty($params['employer_id']) ? $params['employer_id'] : CRM_Utils_Array::value('current_employer', $params);
+       $newContact = FALSE;
+       if (empty($params['contact_id'])) {
+         $newContact = TRUE;
+       }
        if ($newEmployer) {
-         $newContact = FALSE;
-         if (empty($params['contact_id'])) {
-           $newContact = TRUE;
-         }
          CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($contact->id, $newEmployer, $employerId, $newContact);
        }
        else {
Simple merge