From: Eileen McNaughton Date: Fri, 17 Jul 2015 04:53:58 +0000 (+1200) Subject: event search breakage X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6e23130a35ef1abaf0ae9c86d409ad49412a4b7f;p=civicrm-core.git event search breakage --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index edffa26e80..562ed14e1c 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -5181,8 +5181,19 @@ SELECT COUNT( conts.total_amount ) as cancel_count, // widely used and consistent across the codebase // adding this here won't accept the search functions which don't submit an array if (($queryString = CRM_Core_DAO::createSqlFilter($field, $value, $dataType)) != FALSE) { + return $queryString; } + + // This is the here-be-dragons zone. We have no other hopes left for an array so lets assume it 'should' be array('IN' => array(2,5)) + // but we got only array(2,5) from the form. + // We could get away with keeping this in 4.6 if we make it such that it throws an enotice in 4.7 so + // people have to de-slopify it. + if (!empty($value[0])) { + if (($queryString = CRM_Core_DAO::createSqlFilter($field, array($op => $value), $dataType)) != FALSE) { + return $queryString; + } + } } $value = CRM_Utils_Type::escape($value, $dataType); // if we don't have a dataType we should assume diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 6bba6d741a..a08600a826 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -2274,7 +2274,7 @@ SELECT contact_id // http://issues.civicrm.org/jira/browse/CRM-9150 - stick with 'simple' operators for now // support for other syntaxes is discussed in ticket but being put off for now foreach ($filter as $operator => $criteria) { - if (in_array($operator, self::acceptedSQLOperators())) { + if (in_array($operator, self::acceptedSQLOperators(), TRUE)) { switch ($operator) { // unary operators case 'IS NULL':