CRM-12556 - Fix regressions in api_v3_RelationshipTest and api_v3_ActivityTest
authorTim Otten <totten@civicrm.org>
Sun, 21 Jul 2013 05:05:35 +0000 (22:05 -0700)
committerTim Otten <totten@civicrm.org>
Sun, 21 Jul 2013 05:05:35 +0000 (22:05 -0700)
----------------------------------------
* CRM-12556: Assign api_key for a user via command-line
  http://issues.civicrm.org/jira/browse/CRM-12556

api/v3/utils.php

index 9d25ac3fecada41b01103e443c0575ed8478c75a..f0e714b7e0d8a708d6e7b71d29d1a3705ada201c 100644 (file)
@@ -1472,7 +1472,7 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent
   //if fieldname exists in params
   if (CRM_Utils_Array::value($fieldName, $params)) {
     // if value = 'user_contact_id' (or similar), replace value with contact id
-    if (!is_numeric($params[$fieldName])) {
+    if (!is_numeric($params[$fieldName]) && is_scalar($params[$fieldName])) {
       $realContactId = _civicrm_api3_resolve_contactID($params[$fieldName]);
       if ('unknown-user' === $realContactId) {
         throw new API_Exception("\"$fieldName\" \"{$params[$fieldName]}\" cannot be resolved to a contact ID", 2002, array('error_field' => $fieldName,"type"=>"integer"));