CRM-19003: Profile listing doesn't produce expected results when range-searching...
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 19 Jan 2017 11:58:02 +0000 (17:28 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 19 Jan 2017 13:15:29 +0000 (18:45 +0530)
CRM/Profile/Page/Listings.php

index db814c055b76c9aaa288afdc1c75311ffb14b6ec..6cf74ea5eeb3679b3714c11a3e44f61cd0b4bb29 100644 (file)
@@ -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;
+        }
       }
     }