Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 4.6.9
-
Fix Version/s: None
-
Component/s: CiviGrant
-
Labels:
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
Searching for grants by Status or Type results in the error message "(<grant type>) is not of type INTEGER". I've narrowed this down to commit 0a74debbc6ccd6cbbb1304de8e9bfcebcc3f9c61 and the following change:
diff --git a/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php b/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php
index 8cf4854..eeb69e6 100644
--- a/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php
+++ b/sites/all/modules/civicrm/CRM/Contact/BAO/Query.php
@@ -5203,6 +5203,26 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
$clause = " (NULLIF($field, '') IS NOT NULL) ";
return $clause;
- case 'IN':
- case 'NOT IN':
- if (isset($dataType)) {
- if (is_array($value)) {
- $values = $value;
- }
- else {
- $value = CRM_Utils_Type::escape($value, "String");
- $values = explode(',', CRM_Utils_Array::value(0, explode(')', CRM_Utils_Array::value(1, explode('(', $value)))));
- }
- // supporting multiple values in IN clause
- $val = array();
- foreach ($values as $v) {
- $v = trim($v);
- $val[] = "'" . CRM_Utils_Type::escape($v, $dataType) . "'";
- }
- $value = "(" . implode($val, ",") . ")";
- }
- return "$clause $value";
-
default:
if (empty($dataType)) {
$dataType = 'String';
I will submit a pull request.