From 2fa797b9db2c34a0c43de9f813c70b47156dfd39 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Fri, 2 Jan 2015 13:40:37 +0530 Subject: [PATCH] Api test failures fix round3 --- api/v3/utils.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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; + } } /** -- 2.25.1