From: Johan Vervloet Date: Tue, 12 Aug 2014 19:30:20 +0000 (+0200) Subject: CRM-15104 - Fixed a bug in query for price field value. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=438677282fcb64270b50bea2645067948e2a85b6;p=civicrm-core.git CRM-15104 - Fixed a bug in query for price field value. The original query could return NULL instead of the actual price field value if the price set contains multiple price fields. ---------------------------------------- * CRM-15104: Line item issues when creating a participant using the API https://issues.civicrm.org/jira/browse/CRM-15104 --- diff --git a/api/v3/Participant.php b/api/v3/Participant.php index 7a5bc7e216..c3a705b7e6 100644 --- a/api/v3/Participant.php +++ b/api/v3/Participant.php @@ -113,8 +113,8 @@ function _civicrm_api3_participant_createlineitem(&$params, $participant){ FROM civicrm_price_set_entity cpse LEFT JOIN civicrm_price_set ps ON cpse.price_set_id = ps.id AND cpse.entity_id = {$params['event_id']} AND cpse.entity_table = 'civicrm_event' LEFT JOIN civicrm_price_field pf ON pf.`price_set_id` = ps.id - LEFT JOIN civicrm_price_field_value pfv ON pfv.price_field_id = pf.id and pfv.label = '{$label}' - where ps.id is not null + LEFT JOIN civicrm_price_field_value pfv ON pfv.price_field_id = pf.id + where ps.id is not null and pfv.label = '{$label}' "; $dao = CRM_Core_DAO::executeQuery($sql);