-
-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21008 - Checkbox to explicitly change employer when sharing address #13700
Conversation
(Standard links)
|
@@ -146,7 +146,25 @@ public function testCreateAddressWithMasterRelationshipOrganization() { | |||
$this->callAPISuccess('relationship', 'getcount', array( | |||
'contact_id_a' => $individualID, | |||
'contact_id_b' => $this->_contactID, | |||
)); | |||
), 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing unit test of this functionality was actually not testing anything because no expected value was set here.
@@ -166,7 +166,10 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin | |||
|
|||
// Override the default profile links to add address form | |||
$profileLinks = CRM_Contact_BAO_Contact::getEntityRefCreateLinks('shared_address'); | |||
$form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), array('create' => $profileLinks)); | |||
$form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), ['create' => $profileLinks, 'api' => ['extra' => ['contact_type']]]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samuelsov by sending back the contact type here as extra data, I was able to avoid the added ajax callback from your original PR.
Thanks @colemanw, i will test it and get back to you this week. |
test this please |
2 similar comments
test this please |
test this please |
@samuelsov ^^ |
@colemanw @eileenmcnaughton Sorry about the delay. |
Merging as per @samuelsov 's review |
@samuelsov in the future try testing PRs online - each PR gets its own dedicated sandbox which you can reach from civibot's "standard links" above. It expires after a week but you can comment on a pr with the magic "test this" phrase and it will be rebuilt within an hour. |
@colemanw thanks for the tip ! |
This is a reviewer's cut of #12741. I've simplified the logic and added a unit test.