From: yashodha Date: Thu, 2 May 2013 23:10:01 +0000 (+0530) Subject: CRM-12463 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=912e7aaadeadaefd7c17c317e363bdf36104f4e8;p=civicrm-core.git CRM-12463 --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 793df4ee93..6f6c4afce9 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -302,7 +302,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { // Handle soft credit and / or link to personal campaign page if (CRM_Utils_Array::value('deleteSoftCredit', $params, TRUE)) { // first delete soft credits if any - CRM_Contribute_BAO_ContributionSoft::del($contribution->id); + //CRM_Contribute_BAO_ContributionSoft::del($contribution->id); if ($pcp = CRM_Utils_Array::value('pcp', $params)) { $softParams = array(); diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 459cd53e15..351deffc59 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -954,7 +954,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP CRM_Price_BAO_Field::priceSetValidation($priceSetId, $fields, $errors); } } - //CRM_CORE_ERROR::DEBUG($fields['soft_credit_amount']); // if honor roll fields are populated but no PCP is selected if (!CRM_Utils_Array::value('pcp_made_through_id', $fields)) { @@ -1026,7 +1025,6 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP // get the submitted form values. $submittedValues = $this->controller->exportValues($this->_name); - if (CRM_Utils_Array::value('price_set_id', $submittedValues) && $this->_action & CRM_Core_Action::UPDATE) { $line = CRM_Price_BAO_LineItem::getLineItems($this->_id, 'contribution'); $lineID = key($line); @@ -1112,6 +1110,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->assign('lineItem', !empty($lineItem) && !$isQuickConfig ? $lineItem : FALSE); if (CRM_Utils_Array::value('pcp_made_through_id', $submittedValues)) { + $pcp = array(); $fields = array( 'pcp_made_through_id', 'pcp_display_in_roll', @@ -1130,6 +1129,9 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if ($val && $submittedValues['soft_credit_amount'][$key]) { $softParams[$key]['contact_id'] = $val; $softParams[$key]['amount'] = $submittedValues['soft_credit_amount'][$key]; + if ($submittedValues['soft_credit_id'][$key]) { + $softParams[$key]['id'] = $submittedValues['soft_credit_id'][$key]; + } } } }