From a1caac8943c6472fb592ebaf658f650829dd30c8 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 21 Jun 2019 10:41:40 -0400 Subject: [PATCH] Follow up fix on start as a url parameeter --- CRM/Contribute/Form/Search.php | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index 92092f442264..d161d5ddda02 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -152,6 +152,16 @@ public function preProcess() { * @throws \Exception */ public function setDefaultValues() { + $lowReceiveDate = CRM_Utils_Request::retrieve('start', 'Timestamp'); + if (!empty($lowReceiveDate)) { + $this->_formValues['receive_date_low'] = date('Y-m-d H:i:s', strtotime($lowReceiveDate)); + CRM_Core_Error::deprecatedFunctionWarning('pass receive_date_low not start'); + } + $highReceiveDate = CRM_Utils_Request::retrieve('end', 'Timestamp'); + if (!empty($highReceiveDate)) { + $this->_formValues['receive_date_high'] = date('Y-m-d H:i:s', strtotime($highReceiveDate)); + CRM_Core_Error::deprecatedFunctionWarning('pass receive_date_high not end'); + } $this->_defaults = parent::setDefaultValues(); if (empty($this->_defaults['contribution_status'])) { $this->_defaults['contribution_status'][1] = 1; @@ -425,25 +435,6 @@ public function fixFormValues() { } } - $lowDate = CRM_Utils_Request::retrieve('start', 'Timestamp'); - if ($lowDate) { - $lowDate = CRM_Utils_Type::escape($lowDate, 'Timestamp'); - $date = CRM_Utils_Date::setDateDefaults($lowDate); - $this->_formValues['contribution_date_low'] = $this->_defaults['contribution_date_low'] = $date[0]; - } - - $highDate = CRM_Utils_Request::retrieve('end', 'Timestamp'); - if ($highDate) { - $highDate = CRM_Utils_Type::escape($highDate, 'Timestamp'); - $date = CRM_Utils_Date::setDateDefaults($highDate); - $this->_formValues['contribution_date_high'] = $this->_defaults['contribution_date_high'] = $date[0]; - } - - if ($highDate || $lowDate) { - //set the Choose Date Range value - $this->_formValues['contribution_date_relative'] = 0; - } - $this->_limit = CRM_Utils_Request::retrieve('limit', 'Positive', $this );