From 5e9221b7283cef9825f86e3ec63090d22ddd225b Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 16 Apr 2018 15:57:30 +1200 Subject: [PATCH] CRM-21148 revert back to odd handling when NULL passed to getFromTo, deprecate --- CRM/Report/Form.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 6e41d5e1e6..9df5605cf4 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -2056,6 +2056,8 @@ class CRM_Report_Form extends CRM_Core_Form { /** * Get values for from and to for date ranges. * + * @deprecated + * * @param bool $relative * @param string $from * @param string $to @@ -2064,7 +2066,13 @@ class CRM_Report_Form extends CRM_Core_Form { * * @return array */ - public function getFromTo($relative, $from, $to, $fromTime = NULL, $toTime = '235959') { + public function getFromTo($relative, $from, $to, $fromTime = NULL, $toTime = NULL) { + if (empty($toTime)) { + // odd legacy behaviour to treat NULL as 'end of the day' + // recommend updating reports to call CRM_Utils_Date::getFromTo + //directly (default on the function is the actual default there). + $toTime = '235959'; + } return CRM_Utils_Date::getFromTo($relative, $from, $to, $fromTime, $toTime); } -- 2.25.1