$clause = "( {$field['dbAlias']} $sqlOP )";
break;
+ case 'eq':
+ case 'neq':
+ case 'ne':
+ //CRM-18457: some custom field passes value in array format against binary operator
+ if (is_array($value) && count($value)) {
+ $value = $value[0];
+ }
+
default:
- if ($value !== NULL && strlen($value) > 0) {
+ if ($value !== NULL && $value !== '') {
if (isset($field['clause'])) {
// FIXME: we not doing escape here. Better solution is to use two
// different types - data-type and filter-type
$clause = $field['clause'];
}
- else {
+ elseif (!is_array($value)) {
$value = CRM_Utils_Type::escape($value, $type);
$sqlOP = $this->getSQLOperator($op);
if ($field['type'] == CRM_Utils_Type::T_STRING) {