CRM-21214 - Fix address sharing 1 - undo
authorDaniël <9696905+DanielvV@users.noreply.github.com>
Wed, 27 Sep 2017 14:58:37 +0000 (16:58 +0200)
committerGitHub <noreply@github.com>
Wed, 27 Sep 2017 14:58:37 +0000 (16:58 +0200)
This code will not run with the `Address.create` api call
Rewriting and moving to CRM/Core/BAO/Address.php

CRM/Contact/BAO/Contact/Utils.php

index ac9b9256baa10ca317b06b8430ae10eed5210d62..024ef85042031ecbe8f188d1845f2a7e338461d9 100644 (file)
@@ -832,13 +832,6 @@ INNER JOIN civicrm_contact contact_target ON ( contact_target.id = act.contact_i
       $masterAddress->id = CRM_Utils_Array::value('master_id', $values);
       $masterAddress->find(TRUE);
 
-      //if address master address is shared, use its master (prevent chaining) CRM-21214
-      if ($masterAddress->master_id > 0) {
-        $values['master_id'] = $masterAddress->master_id;
-        $masterAddress->id = CRM_Utils_Array::value('master_id', $values);
-        $masterAddress->find(TRUE);
-      }
-
       // 4. modify submitted params and update it with shared contact address
       // make sure you preserve specific form values like location type, is_primary_ is_billing, master_id
       // CRM-10336: Also empty any fields from the existing address block if they don't exist in master (otherwise they will persist)