Skip to content

Commit

Permalink
Merge pull request #9392 from monishdeb/CRM-19394
Browse files Browse the repository at this point in the history
CRM-19394: Relative date is not processed correctly
  • Loading branch information
monishdeb authored Nov 21, 2016
2 parents 001edd3 + fc7dc7c commit ce12654
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,13 @@ public static function convertFormValues(&$formValues, $wildcard = 0, $useEquals
}

if (array_key_exists($fromRange, $formValues) && array_key_exists($toRange, $formValues)) {
// relative dates are not processed correctly as lower date value were ignored,
// to ensure both high and low date value got added IF there is relative date,
// we need to reset $formValues by unset and then adding again via CRM_Contact_BAO_Query::fixDateValues(...)
if (!empty($formValues[$id])) {
unset($formValues[$fromRange]);
unset($formValues[$toRange]);
}
CRM_Contact_BAO_Query::fixDateValues($formValues[$id], $formValues[$fromRange], $formValues[$toRange]);
continue;
}
Expand Down

0 comments on commit ce12654

Please sign in to comment.