Skip to content

Commit

Permalink
Merge pull request #9437 from JMAConsulting/CRM-19681
Browse files Browse the repository at this point in the history
 CRM-19681, fixed code to respect date filters passed from url for report
  • Loading branch information
monishdeb authored Nov 24, 2016
2 parents 05b465b + dd56d5d commit 109fb78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CRM/Report/Utils/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ public static function dateParam($fieldName, &$field, &$defaults) {
$from = self::getTypedValue("{$fieldName}_from", $type);
$to = self::getTypedValue("{$fieldName}_to", $type);

$relative = CRM_Utils_Array::value("{$fieldName}_relative", $_GET);
$relative = self::getTypedValue("{$fieldName}_relative", CRM_Utils_Type::T_STRING);
if ($relative !== NULL) {
$defaults["{$fieldName}_relative"] = $relative;
}
if ($relative) {
list($from, $to) = CRM_Report_Form::getFromTo($relative, NULL, NULL);
list($from, $to) = CRM_Utils_Date::getFromTo($relative, NULL, NULL);
$from = substr($from, 0, 8);
$to = substr($to, 0, 8);
}
Expand Down

0 comments on commit 109fb78

Please sign in to comment.