Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21049

Can't create a RelationshipType record via API with "All Contacts" as a value

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.23
    • Fix Version/s: 4.7.25
    • Component/s: CiviCRM API
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      RelationshipType fields have the fields `contact_type_a` and `contact_type_b` to indicate what contact types are valid for that relationship type (e.g. "Employee Of/Employer Of" can only be an Individual to an Organization).

      You can also specify "All Contacts" as an option in the UI, which sets the value to NULL in the database for the corresponding field.

      However, the API create spec says that "contact_type_a" and "contact_type_b" are required - so you can't specify NULL.

      To replicate: Go to API explorer.  Attempt to create a record with a Contact Type of "All Contacts".

      PR incoming.

        Attachments

          Activity

            People

            • Assignee:
              palantejon Jon K Goldberg
              Reporter:
              palantejon Jon K Goldberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: