From 2c30b3f4ad2551f6566af066f4c871c1d00c4781 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Thu, 19 Jan 2017 17:28:02 +0530 Subject: [PATCH] CRM-19003: Profile listing doesn't produce expected results when range-searching custom date field --- CRM/Profile/Page/Listings.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php index db814c055b..6cf74ea5ee 100644 --- a/CRM/Profile/Page/Listings.php +++ b/CRM/Profile/Page/Listings.php @@ -161,14 +161,14 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { $to = CRM_Utils_Request::retrieve($name . '_to', 'String', $this); $value = array(); if ($from && $to) { - $value['from'] = $from; - $value['to'] = $to; + $value[$name . '_from'] = $from; + $value[$name . '_to'] = $to; } elseif ($from) { - $value['from'] = $from; + $value[$name . '_from'] = $from; } elseif ($to) { - $value['to'] = $to; + $value[$name . '_to'] = $to; } } elseif ((substr($name, 0, 7) == 'custom_') && @@ -247,7 +247,12 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page { if ($operator) { $this->_params[$name . '_operator'] = $operator; } - $this->_params[$name] = $this->_fields[$name]['value'] = $value; + if ((substr($name, 0, 6) == 'custom') && !empty($field['is_search_range'])) { + $this->_params += $value; + } + else { + $this->_params[$name] = $this->_fields[$name]['value'] = $value; + } } } -- 2.25.1