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

membership api/bao: max_related is ignored if owner_membership_id isset

    Details

    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      generate an api call to create a membership record
      set the max_related field
      include the owner_membership_id field, but set to null

      expected: max_related value is stored
      actual: value is set to null

      the issue is this line:
      https://github.com/civicrm/civicrm-core/blob/master/CRM/Member/BAO/Membership.php#L287

      I am 99% sure we should be doing "!empty($params['ownder_membership_id'])" instead of isset. We don't care if the array key is set – we care if there's a value in that field, because in that case we are looking at a child/inherited membership and there should be no max_related value for it (that's only pertinent to the parent membership).

      but before filing a PR, I'd like someone to review in case I'm missing something obvious...

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: