Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.11
-
Fix Version/s: 4.7.12
-
Component/s: CiviCRM API, CiviMail
-
Labels:
-
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...