From c4853004f2022d1bb3f1bd48c8f5c7ef93aef328 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 1 Sep 2019 11:57:28 +1000 Subject: [PATCH] Ensure that relative dates are handled in the newer way --- CRM/Contact/BAO/Query.php | 9 ++++++++- CRM/Pledge/BAO/Query.php | 8 ++++++++ xml/schema/Pledge/PledgePayment.xml | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 7a6b045758..ea0bedf7f4 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1584,7 +1584,14 @@ 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', 'receive_date_relative']; + $nonLegacyDateFields = [ + 'participant_register_date_relative', + 'receive_date_relative', + 'pledge_end_date_relative', + 'pledge_create_date_relative', + 'pledge_start_date_relative', + 'pledge_payment_scheduled_date_relative', + ]; // Handle relative dates first foreach (array_keys($formValues) as $id) { if ( diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 733e26abda..824eef7dc3 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -282,6 +282,14 @@ class CRM_Pledge_BAO_Query extends CRM_Core_BAO_Query { ); return; + case 'pledge_payment_scheduled_date_low': + case 'pledge_payment_scheduled_date_high': + // process to / from date + $query->dateQueryBuilder($values, + 'civicrm_pledge_payment', 'pledge_payment_scheduled_date', 'scheduled_date', 'Payment Scheduled' + ); + return; + case 'pledge_amount': case 'pledge_amount_low': case 'pledge_amount_high': diff --git a/xml/schema/Pledge/PledgePayment.xml b/xml/schema/Pledge/PledgePayment.xml index 459c03206d..bc711aef43 100644 --- a/xml/schema/Pledge/PledgePayment.xml +++ b/xml/schema/Pledge/PledgePayment.xml @@ -60,6 +60,7 @@ pledge_payment_scheduled_amount Scheduled Amount true + true decimal true Pledged amount for this payment (the actual contribution amount might be different). -- 2.25.1