Details
- 
    Type:
Bug
 - 
    Status: Done/Fixed
 - 
    Priority:
Minor
 - 
    Resolution: Fixed/Completed
 - 
    Affects Version/s: 2.2.3
 - 
    Fix Version/s: 2.2.6
 - 
    Component/s: CiviMember
 - 
    Labels:None
 
Description
CRM_Member_BAO_Membership::getContactMembership does not return latest membership record.
This can cause problems when an organisation with two membership records is called. The method can mistakenly return that they are not a member ([is_current_member] => 0) if it looks at an older record which has expired.
The bug is fixed by adding the following at line 649 in CRM/Member/BAO/Membership.php
$dao->orderBy('start_date DESC');