From 5a01772c79b6c81eb16c04261903c8d926377df8 Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy Date: Mon, 9 Jun 2014 22:20:35 -0400 Subject: [PATCH] CRM-14831 check if membership type is present on contrib page to display renew link --- CRM/Member/Page/UserDashboard.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Member/Page/UserDashboard.php b/CRM/Member/Page/UserDashboard.php index 1669ecb992..3057216d74 100644 --- a/CRM/Member/Page/UserDashboard.php +++ b/CRM/Member/Page/UserDashboard.php @@ -72,7 +72,14 @@ class CRM_Member_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBoard 'default_renewal_contribution_page' ); if ($defaultRenewPageId) { - $membership[$dao->id]['renewPageId'] = $defaultRenewPageId; + //CRM-14831 - check if membership type is present in contrib page + $memBlock = CRM_Member_BAO_Membership::getMembershipBlock($defaultRenewPageId); + if ( !empty($memBlock['membership_types']) ) { + $memTypes = explode(',', $memBlock['membership_types']); + if ( in_array($dao->membership_type_id, $memTypes) ) { + $membership[$dao->id]['renewPageId'] = $defaultRenewPageId; + } + } } } } -- 2.25.1