From: monishdeb Date: Fri, 2 Jan 2015 08:10:37 +0000 (+0530) Subject: Api test failures fix round3 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2fa797b9db2c34a0c43de9f813c70b47156dfd39;p=civicrm-core.git Api test failures fix round3 --- diff --git a/api/v3/utils.php b/api/v3/utils.php index 6942074631..112e4a6e7e 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1827,7 +1827,7 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent if ('unknown-user' === $realContactId) { throw new API_Exception("\"$fieldName\" \"{$fieldValue}\" cannot be resolved to a contact ID", 2002, array('error_field' => $fieldName,"type"=>"integer")); } elseif (is_numeric($realContactId)) { - $params[$fieldName] = $fieldValue = $realContactId; + $fieldValue = $realContactId; } } if (!empty($fieldInfo['pseudoconstant']) || !empty($fieldInfo['options'])) { @@ -1849,6 +1849,13 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent ); } } + + if (!empty($op)) { + $params[$fieldName][$op] = $fieldValue; + } + else { + $params[$fieldName] = $fieldValue; + } } /** @@ -1957,6 +1964,13 @@ function _civicrm_api3_validate_string(&$params, &$fieldName, &$fieldInfo, $enti ); } } + + if (!empty($op)) { + $params[$fieldName][$op] = $fieldValue; + } + else { + $params[$fieldName] = $fieldValue; + } } /**