CRM-17204 - Empty Current Employer profile field disables employer relationship
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 22 Sep 2015 12:32:52 +0000 (18:02 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 22 Sep 2015 12:32:52 +0000 (18:02 +0530)
CRM/Contact/BAO/Contact.php

index 1afebccd3484e4f4402a2278b0a5d307b1cbcdcd..2902689de191492cebd4a66e132427d099a415a8 100644 (file)
@@ -2300,8 +2300,8 @@ ORDER BY civicrm_email.is_primary DESC";
                 'suffix_id',
               )) &&
             ($value == '' || !isset($value)) &&
-            ($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0
-          ) {
+            ($session->get('authSrc') & (CRM_Core_Permission::AUTH_SRC_CHECKSUM + CRM_Core_Permission::AUTH_SRC_LOGIN)) == 0 ||
+            ($key == 'current_employer' && empty($params['current_employer']))) {
             // CRM-10128: if auth source is not checksum / login && $value is blank, do not fill $data with empty value
             // to avoid update with empty values
             continue;