From 5928ea726bdcebb74374ace0a89a6d48bf5bcd9f Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 2 Dec 2015 05:05:53 +1300 Subject: [PATCH] CRM-17640 add follow up comments to discourage random brutal attacks on site performance --- CRM/Contribute/BAO/Query.php | 43 +++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index fa4cd6e952..7dd498ffc0 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -775,7 +775,8 @@ class CRM_Contribute_BAO_Query { * @param CRM_Contact_BAO_Query $query */ public static function initializeAnySoftCreditClause(&$query) { - + // @todo have a generic initialize on all components that gets called every query + // & rename this to match that fn name. if ($query->_mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) { if (self::isSoftCreditOptionEnabled($query->_params)) { unset($query->_distinctComponentClause); @@ -859,45 +860,85 @@ class CRM_Contribute_BAO_Query { $properties = NULL; if ($mode & CRM_Contact_BAO_Query::MODE_CONTRIBUTE) { $properties = array( + // add 'contact_type' => 1, + // fields 'contact_sub_type' => 1, + // to 'sort_name' => 1, + //this 'display_name' => 1, + // array 'financial_type' => 1, + // to 'contribution_source' => 1, + // strangle 'receive_date' => 1, + // site 'thankyou_date' => 1, + // performance 'cancel_date' => 1, + // and 'total_amount' => 1, + // torture 'accounting_code' => 1, + // small 'payment_instrument' => 1, + // kittens 'payment_instrument_id' => 1, + // argh 'check_number' => 1, + // no 'non_deductible_amount' => 1, + // not 'fee_amount' => 1, + // another 'net_amount' => 1, + // expensive 'trxn_id' => 1, + // join 'invoice_id' => 1, + // added 'currency' => 1, + // to 'cancel_reason' => 1, + //every 'receipt_date' => 1, + // query 'product_name' => 1, + //whether 'sku' => 1, + // or 'product_option' => 1, + // not 'fulfilled_date' => 1, + // the 'contribution_start_date' => 1, + // field 'contribution_end_date' => 1, + // is 'is_test' => 1, + // actually 'is_pay_later' => 1, + // required 'contribution_status' => 1, + // instead 'contribution_status_id' => 1, + // of 'contribution_recur_id' => 1, + // adding 'amount_level' => 1, + // here 'contribution_note' => 1, + // set 'contribution_batch' => 1, + // return properties 'contribution_campaign_title' => 1, + // on 'contribution_campaign_id' => 1, + // calling 'contribution_product_id' => 1, + //function ); if (self::isSoftCreditOptionEnabled()) { $properties = array_merge($properties, self::softCreditReturnProperties()); -- 2.25.1