This improves support for relative dates for fields that have been converted.
For example
http://dmaster.local/civicrm/contribute/search?reset=1&receive_date_relative=this.year&force=1
Now works to render donations 'This Calendar Year'
* @param string $entity
*
* @return array
+ *
+ * @throws \CRM_Core_Exception
*/
protected function getEntityDefaults($entity) {
$defaults = [];
$defaults[$fieldName . '_low'] = $low ? date('Y-m-d H:i:s', strtotime($low)) : NULL;
$defaults[$fieldName . '_high'] = $high ? date('Y-m-d H:i:s', strtotime($high)) : NULL;
}
+ else {
+ $relative = CRM_Utils_Request::retrieveValue($fieldName . '_relative', 'String', NULL, NULL, 'GET');
+ if (!empty($relative) && isset(CRM_Core_OptionGroup::values('relative_date_filters')[$relative])) {
+ $defaults[$fieldName . '_relative'] = $relative;
+ }
+ }
}
}
}