Skip to content

Instantly share code, notes, and snippets.

diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php
index d46fb26..c7e3ce8 100644
--- a/CRM/Contribute/BAO/Contribution.php
+++ b/CRM/Contribute/BAO/Contribution.php
@@ -387,7 +387,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
$softParams['soft_credit_type_id'] = CRM_Core_OptionGroup::getValue('soft_credit_type', 'pcp', 'name');
$contributionSoft = CRM_Contribute_BAO_ContributionSoft::add($softParams);
//Send notification to owner for PCP
- if ($contributionSoft->pcp_id) {
+ if ($contributionSoft->pcp_id && empty($pcpId)) {
diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php
index d46fb26..92188b6 100644
--- a/CRM/Contribute/BAO/Contribution.php
+++ b/CRM/Contribute/BAO/Contribution.php
@@ -374,6 +374,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
if ($pcp = CRM_Utils_Array::value('pcp', $params)) {
$softParams = array();
+ $softParams['id'] = $pcpId ? $pcpId : NULL;
$softParams['contribution_id'] = $contribution->id;
diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php
index d46fb26..9062f5c 100644
--- a/CRM/Contribute/BAO/Contribution.php
+++ b/CRM/Contribute/BAO/Contribution.php
@@ -374,6 +374,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
if ($pcp = CRM_Utils_Array::value('pcp', $params)) {
$softParams = array();
+ $softParams['id'] = $pcpId ? $pcpId : NULL;
$softParams['contribution_id'] = $contribution->id;
diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php
index 37b00ab..7514a13 100644
--- a/CRM/Core/BAO/CustomQuery.php
+++ b/CRM/Core/BAO/CustomQuery.php
@@ -424,12 +424,12 @@ SELECT label, value
// CRM-14563,CRM-16575 : Special handling of multi-select custom fields
if ($isSerialized && !empty($value)) {
if (strstr($op, 'IN')) {
- $value = str_replace(array('(', ')'), '', str_replace(",", "[[:cntrl:]]|[[:cntrl:]]", $value));
+ $value = str_replace(",", "[[:cntrl:]]*|[[:cntrl:]]*", $value);
@monishdeb
monishdeb / gist:de1536eb029c58ff197a
Created October 9, 2015 15:46
RM-12989, Editing memberships, contributions or event registrations in multiple tabs replaces data
diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php
index 7fb7a90..162c37d 100644
--- a/CRM/Contribute/Form/AbstractEditPayment.php
+++ b/CRM/Contribute/Form/AbstractEditPayment.php
@@ -209,7 +209,15 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Contact_Form_Task {
* Pre process function with common actions.
*/
public function preProcess() {
- $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
+ //CRM-12989, allocate entity and contact id, retrieved from controller->_entryURL rather than REQUEST to
diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php
index 04778d5..4804785 100644
--- a/CRM/Contact/BAO/Query.php
+++ b/CRM/Contact/BAO/Query.php
@@ -1502,12 +1502,13 @@ class CRM_Contact_BAO_Query {
foreach ($formValues as $id => $values) {
- self::legacyConvertFormValues($id, $values);
-
diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php
index 798f730..19dfdfc 100644
--- a/CRM/Contact/BAO/Query.php
+++ b/CRM/Contact/BAO/Query.php
@@ -3302,7 +3302,7 @@ WHERE $smartGroupClause
$value = $strtolower(CRM_Core_DAO::escapeString(trim($value)));
if (strlen($value)) {
$fieldsub = array();
- $value = "'" . $this->getWildCardedValue($wildcard, $op, $value) . "'";
+ $value = "'" . self::getWildCardedValue($wildcard, $op, $value) . "'";
diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php
index fc8ab4e..3237c81 100644
--- a/CRM/Core/Payment/AuthorizeNet.php
+++ b/CRM/Core/Payment/AuthorizeNet.php
@@ -23,6 +23,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
const AUTH_APPROVED = 1;
const AUTH_DECLINED = 2;
const AUTH_ERROR = 3;
+ const AUTH_REVIEW = 4;
const TIMEZONE = 'America/Denver';
diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php
index fc8ab4e..19b4bce 100644
--- a/CRM/Core/Payment/AuthorizeNet.php
+++ b/CRM/Core/Payment/AuthorizeNet.php
@@ -23,6 +23,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
const AUTH_APPROVED = 1;
const AUTH_DECLINED = 2;
const AUTH_ERROR = 3;
+ const AUTH_REVIEW = 4;
const TIMEZONE = 'America/Denver';
diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php
index 85e660f..c24fd88 100644
--- a/CRM/Export/BAO/Export.php
+++ b/CRM/Export/BAO/Export.php
@@ -764,12 +764,14 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
$limitReached = FALSE;
while (!$limitReached) {
$limitQuery = "{$queryString} LIMIT {$offset}, {$rowCount}";
- $dao = CRM_Core_DAO::executeQuery($limitQuery);
+ $dao = CRM_Core_DAO::executeUnbufferedQuery($limitQuery);