From: Seamus Lee Date: Fri, 14 Jun 2019 21:33:15 +0000 (+1000) Subject: Fix Batch searching on receive date follwoing conversion and handle receive_date... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5d7e6440f03cf945b995ce0c8c2ed33e847ffeef;p=civicrm-core.git Fix Batch searching on receive date follwoing conversion and handle receive_date param for the moment as not properly namespaced --- diff --git a/CRM/Batch/BAO/Batch.php b/CRM/Batch/BAO/Batch.php index fb2b2a3261..771c0cc412 100644 --- a/CRM/Batch/BAO/Batch.php +++ b/CRM/Batch/BAO/Batch.php @@ -709,15 +709,14 @@ LEFT JOIN civicrm_contribution_soft ON civicrm_contribution_soft.contribution_id 'contribution_receipt_date_is_not_null', 'contribution_pcp_made_through_id', 'contribution_pcp_display_in_roll', - 'contribution_date_relative', 'contribution_amount_low', 'contribution_amount_high', 'contribution_in_honor_of', 'contact_tags', 'group', - 'contribution_date_relative', - 'contribution_date_high', - 'contribution_date_low', + 'receive_date_relative', + 'receive_date_high', + 'receive_date_low', 'contribution_check_number', 'contribution_status_id', 'financial_trxn_card_type_id', @@ -740,11 +739,11 @@ LEFT JOIN civicrm_contribution_soft ON civicrm_contribution_soft.contribution_id if ($field == 'group') { $from .= " LEFT JOIN civicrm_group_contact `civicrm_group_contact-{$params[$field]}` ON contact_a.id = `civicrm_group_contact-{$params[$field]}`.contact_id "; } - if ($field == 'contribution_date_relative') { + if ($field == 'receive_date_relative') { $relativeDate = explode('.', $params[$field]); $date = CRM_Utils_Date::relativeToAbsolute($relativeDate[0], $relativeDate[1]); - $values['contribution_date_low'] = $date['from']; - $values['contribution_date_high'] = $date['to']; + $values['receive_date_low'] = $date['from']; + $values['receive_date_high'] = $date['to']; } } } diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 5c99185663..3b4c7802fd 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1554,7 +1554,7 @@ class CRM_Contact_BAO_Query { self::filterCountryFromValuesIfStateExists($formValues); // We shouldn't have to whitelist fields to not hack but here we are, for now. - $nonLegacyDateFields = ['participant_register_date_relative']; + $nonLegacyDateFields = ['participant_register_date_relative', 'receive_date_relative']; // Handle relative dates first foreach (array_keys($formValues) as $id) { if (