CRM-16036 - Pleasing the php 5.3 gods :-)
authorJohan Vervloet <johanv@johanv.org>
Tue, 10 Mar 2015 19:02:39 +0000 (20:02 +0100)
committereileenmcnaugton <eileen@fuzion.co.nz>
Wed, 12 Aug 2015 23:39:34 +0000 (11:39 +1200)
Thank you @colemanw.

----------------------------------------
* CRM-16036: API: searching on custom fields does not work
  https://issues.civicrm.org/jira/browse/CRM-16036

api/v3/utils.php

index b3dfe2a084d1a1537a86caef9e03cbe1d5697a52..dd01e86104a0a31fc75767a1277ced5aa708c580 100644 (file)
@@ -530,7 +530,8 @@ function _civicrm_api3_get_using_query_object_simple($dao_name, $params, $return
     else {
       // We expect only one element in the array, of the form
       // "operator" => "rhs".
-      $operator = array_keys($value)[0];
+      $dummy = array_keys($value);
+      $operator = $dummy[0];
       if (!in_array($operator, CRM_Core_DAO::acceptedSQLOperators())) {
         // if operator not found, use = as default.
         $operator = "=";