From 4efc56eff23f4670d29e41afd7999c0b93791b4f Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 12 May 2015 17:44:18 +1200 Subject: [PATCH] Fix to formRule refactor --- CRM/Member/Form/Membership.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 702d54899b..ad378fcc7f 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -115,13 +115,16 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { ); /** - * @param $self - * @param $priceFieldIDS + * Get selected membership type from the form values. + * + * @param int $priceSetID + * @param array $params + * + * @return array */ public static function getSelectedMemberships($priceSetID, $params) { $memTypeSelected = array(); $priceFieldIDS = self::getPriceFieldIDs($params); - if ($priceSetID && is_array($priceFieldIDS)) { foreach ($priceFieldIDS as $priceFieldId) { if ($id = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $priceFieldId, 'membership_type_id')) { @@ -130,7 +133,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { } } else { - $memTypeSelected = $params['membership_type_id'][1]; + $memTypeSelected = $params['membership_type_id']; } return $memTypeSelected; } -- 2.25.1