From 4339a82a8216745062b2c9e58f3dc9d289d677a4 Mon Sep 17 00:00:00 2001 From: Johan Vervloet Date: Thu, 27 Aug 2015 21:52:56 +0200 Subject: [PATCH] CRM-17101 - A bug fix. ---------------------------------------- * CRM-17101: civicrm_api3_basic_get does not work for SQL operators on custom fields. https://issues.civicrm.org/jira/browse/CRM-17101 --- api/v3/utils.php | 2 +- tests/phpunit/api/v3/EventTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v3/utils.php b/api/v3/utils.php index d2b8495f83..11ed468c96 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -641,7 +641,7 @@ function _civicrm_api3_get_using_utils_sql($dao_name, $params, $isFillUniqueFiel ); } else { - $query->where(CRM_Core_DAO::createSQLFilter('a.' . $column_name, $value, $type)); + $query->where(CRM_Core_DAO::createSQLFilter("{$table_name}.{$column_name}", $value, $type)); } } } diff --git a/tests/phpunit/api/v3/EventTest.php b/tests/phpunit/api/v3/EventTest.php index 1149b8e596..7560a5087e 100644 --- a/tests/phpunit/api/v3/EventTest.php +++ b/tests/phpunit/api/v3/EventTest.php @@ -451,7 +451,7 @@ class api_v3_EventTest extends CiviUnitTestCase { /** * Test searching on custom fields with less than or equal. - * + * * See CRM-17101. */ public function testEventGetCustomFieldLte() { -- 2.25.1