CRM-17101 - A bug fix.
authorJohan Vervloet <johanv@johanv.org>
Thu, 27 Aug 2015 19:52:56 +0000 (21:52 +0200)
committerJohan Vervloet <johanv@johanv.org>
Thu, 27 Aug 2015 19:52:56 +0000 (21:52 +0200)
----------------------------------------
* 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
tests/phpunit/api/v3/EventTest.php

index d2b8495f83030c74122eeae65e66674e337a7856..11ed468c96fb3795951132f0e7f2802fc0ae5e12 100644 (file)
@@ -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));
       }
     }
   }
index 1149b8e596ccbc4a33ad64833c3d496633e15c22..7560a5087e4a586fe5f5ebfc309da84b4a0a7e16 100644 (file)
@@ -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() {