From: Ruben Rodriguez Date: Mon, 12 Mar 2018 23:47:35 +0000 (-0400) Subject: BIG HACK: Corrected frequency calculation for new members X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b3406e109fc745da4ba59f0b37c9b88329ce9bcb;p=civicrm-core.git BIG HACK: Corrected frequency calculation for new members --- diff --git a/CRM/Price/BAO/PriceSet.php b/CRM/Price/BAO/PriceSet.php index 6b123b2a48..c711ed0b1e 100644 --- a/CRM/Price/BAO/PriceSet.php +++ b/CRM/Price/BAO/PriceSet.php @@ -1209,12 +1209,14 @@ GROUP BY mt.member_of_contact_id "; * @return array * associate array of frequency interval and unit */ - public static function getRecurDetails($priceSetId) { + // Ruben Added `, $priceFieldValueIds` here. + public static function getRecurDetails($priceSetId, $priceFieldValueIds) { $query = 'SELECT mt.duration_interval, mt.duration_unit FROM civicrm_price_field_value pfv INNER JOIN civicrm_membership_type mt ON pfv.membership_type_id = mt.id INNER JOIN civicrm_price_field pf ON pfv.price_field_id = pf.id - WHERE pf.price_set_id = %1 LIMIT 1'; + WHERE pf.price_set_id = %1 AND pfv.id = ' + . $priceFieldValueIds . ' LIMIT 1'; $params = [1 => [$priceSetId, 'Integer']]; $dao = CRM_Core_DAO::executeQuery($query, $params);