projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
388d10d
)
Add a check for when there is no membership id
author
Tyrell Cook
<tyrell@aghstrategies.com>
Wed, 8 Apr 2015 21:29:45 +0000
(17:29 -0400)
committer
Tyrell Cook
<tyrell@aghstrategies.com>
Wed, 8 Apr 2015 21:29:45 +0000
(17:29 -0400)
CRM/Member/BAO/Membership.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Member/BAO/Membership.php
b/CRM/Member/BAO/Membership.php
index 30d77c26d1d16422412f75f21afb4aee06cab512..bd9daf1219bf2bd1db6d5722fbbb2bab99c98245 100644
(file)
--- a/
CRM/Member/BAO/Membership.php
+++ b/
CRM/Member/BAO/Membership.php
@@
-1056,6
+1056,17
@@
INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_ty
$membership['status_id'],
'is_current_member', 'id'
);
+ $ownerMemberId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership',
+ $membership['id'],
+ 'owner_membership_id', 'id'
+ );
+ if ($ownerMemberId) {
+ $membership['id'] = $membership['membership_id'] = $ownerMemberId;
+ $membership['membership_contact_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership',
+ $membership['id'],
+ 'contact_id', 'id'
+ );
+ }
return $membership;
}