Skip to content
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-21049 - Allow creating relationship types with no contact type specified #10839

Merged
merged 1 commit into from
Aug 22, 2017

Conversation

MegaphoneJon
Copy link
Contributor

@MegaphoneJon MegaphoneJon commented Aug 9, 2017

Overview

The API currently doesn't allow creating a relationship type with contact type of "All Contacts". This is intended to fix this.

Before

The API create spec defines contact_type_a and contact_type_b as required, and locks this functionality in via a unit test.

After

I removed the lines from the spec and removed/updated the unit tests locking in the incorrect behavior.

Comments

This code hasn't been touched since Civi was migrated from SVN to git - so it might be that once upon a time there was no way to specify "All Contacts" via leaving contact_type_a or contact_type_b as NULL.


@civicrm-builder
Copy link

Can one of the admins verify this patch?

@MegaphoneJon
Copy link
Contributor Author

Hmm - I suspect that I need to be whitelisted again since my Github name has changed.

@colemanw
Copy link
Member

@civicrm-builder add to whitelist

@colemanw
Copy link
Member

I suspect a hack/workaround from your end could be to call the api with the string 'null' as the value for those fields. But I like this better :)

@monishdeb
Copy link
Member

@MegaphoneJon can you mention the JIRA issue number in the PR title?

@lcdservices
Copy link
Contributor

I tested and verified this PR. you can now create relationship types via the API with no contact type identified.

@MegaphoneJon MegaphoneJon changed the title Allow creating relationship types with no contact type specified CRM-21049 - Allow creating relationship types with no contact type specified Aug 22, 2017
@colemanw colemanw merged commit 8af1022 into civicrm:master Aug 22, 2017
@MegaphoneJon MegaphoneJon deleted the CRM-21049 branch October 10, 2017 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants