From: Dave Greenberg Date: Thu, 19 Jun 2014 17:47:24 +0000 (-0700) Subject: CRM-14875 - Make sure line items show up for any contribution, event reg or membershi... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cd0956367b859ca329b41cc0f77d5fe260ce5fdf;p=civicrm-core.git CRM-14875 - Make sure line items show up for any contribution, event reg or membership signup which uses a non-quick-config price set. ---------------------------------------- * CRM-14875: https://issues.civicrm.org/jira/browse/CRM-14875 --- diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index b8eb7543de..db938fc092 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -141,7 +141,9 @@ AND li.entity_id = {$entityId} $fromClause = " FROM civicrm_%2 as %2 - LEFT JOIN civicrm_line_item li ON ( li.entity_id = %2.id AND li.entity_table = 'civicrm_%2') + LEFT JOIN civicrm_line_item li ON (( li.entity_id = %2.id AND li.entity_table = 'civicrm_%2') + OR (li.contribution_id = %2.id AND li.entity_table = 'civicrm_membership') + OR (li.contribution_id = %2.id AND li.entity_table = 'civicrm_participant')) LEFT JOIN civicrm_price_field_value pfv ON ( pfv.id = li.price_field_value_id ) LEFT JOIN civicrm_price_field pf ON (pf.id = li.price_field_id )"; $whereClause = " @@ -167,7 +169,7 @@ AND li.entity_id = {$entityId} 2 => array($entity, 'Text'), ); - $dao = CRM_Core_DAO::executeQuery("$selectClause $fromClause $whereClause", $params); + $dao = CRM_Core_DAO::executeQuery("$selectClause $fromClause $whereClause ORDER by li.id", $params); while ($dao->fetch()) { if (!$dao->id) { continue;