From: jitendrapurohit Date: Mon, 7 Mar 2016 11:21:27 +0000 (+0530) Subject: optimisation fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fbb6a316d96ecdb3180b9136e15d975712eecd55;p=civicrm-core.git optimisation fixes --- diff --git a/CRM/Price/BAO/PriceFieldValue.php b/CRM/Price/BAO/PriceFieldValue.php index 9014684df7..519122e18f 100644 --- a/CRM/Price/BAO/PriceFieldValue.php +++ b/CRM/Price/BAO/PriceFieldValue.php @@ -320,18 +320,13 @@ WHERE cpse.id IS NOT NULL {$where}"; 2 => array(CRM_Core_DAO::VALUE_SEPARATOR . $newLabel . ' -', 'String'), ); $participantIds = array(); + // Update contribution if (!empty($lineItem->contribution_id)) { CRM_Core_DAO::executeQuery("UPDATE `civicrm_contribution` SET `amount_level` = REPLACE(amount_level, %1, %2) WHERE id = {$lineItem->contribution_id}", $params); - $participantIds = CRM_Event_BAO_Participant::getParticipantIds($lineItem->contribution_id); } - // if contribution is not attached to the participant. - if (empty($participantIds) && $lineItem->entity_table == 'civicrm_participant') { - $participantIds[] = $lineItem->entity_id; - } - foreach ($participantIds as $key => $id) { - if (!empty($id)) { - CRM_Core_DAO::executeQuery("UPDATE `civicrm_participant` SET `fee_level` = REPLACE(fee_level, %1, %2) WHERE id = {$id}", $params); - } + // Update participant + if ($lineItem->entity_table == 'civicrm_participant') { + CRM_Core_DAO::executeQuery("UPDATE `civicrm_participant` SET `fee_level` = REPLACE(fee_level, %1, %2) WHERE id = {$lineItem->entity_id}", $params); } } }