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

API ( contact, create ) does not always create related membership

    Details

    • Documentation Required?:
      None

      Description

      When:

      • a membership type is defined that inherits from an employment relationship with unlimited related members
      • an organization has a membership of that type
      • you are creating contacts through the API with an employer_id or current_employer_id attribute pointing to the above organization
        Then the contact and employment relationships are created fine, but the related memberships are only created for the first contact attached to the organization, but not for subsequent contacts. So after creating several contacts, if you View the organization membership, you will see that only one related membership has been created.

      Reproduced on the demo site. This bug does not seem to affect contacts created through the Add Individual screen, but I have not tested other screens that should create a related contact in the DB (ie. add membership on organization, membership creation page, profiles, etc). Since the API uses the BAO in a very straightforward way, it would not surprise me that this bug shows up in other parts of CiviCRM.

        Attachments

        1. screenshot.142.jpg
          660 kB
          Nicolas Ganivet
        2. screenshot.143.jpg
          613 kB
          Nicolas Ganivet

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              nganivet Nicolas Ganivet
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: