}
}
if (!empty($fieldInfo['pseudoconstant']) || !empty($fieldInfo['options'])) {
- _civicrm_api3_api_match_pseudoconstant($fieldValue, $entity, $fieldName, $fieldInfo);
+ _civicrm_api3_api_match_pseudoconstant($fieldValue, $entity, $fieldName, $fieldInfo, $op);
}
// After swapping options, ensure we have an integer(s)
}
}
if (!empty($fieldInfo['pseudoconstant']) || !empty($fieldInfo['options'])) {
- _civicrm_api3_api_match_pseudoconstant($fieldValue, $entity, $fieldName, $fieldInfo);
+ _civicrm_api3_api_match_pseudoconstant($fieldValue, $entity, $fieldName, $fieldInfo, $op);
}
// Check our field length
elseif (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen(utf8_decode($fieldValue)) > $fieldInfo['maxlength']) {
* @param string $entity : api entity name
* @param string $fieldName : field name used in api call (not necessarily the canonical name)
* @param array $fieldInfo : getfields meta-data
+ * @param string $op
*
* @throws \API_Exception
*/
-function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldName, $fieldInfo) {
+function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldName, $fieldInfo, $op = '=') {
+ if (in_array($op, array('>', '<', '>=', '<=', 'LIKE', 'NOT LIKE'))) {
+ return;
+ }
+
$options = CRM_Utils_Array::value('options', $fieldInfo);
if (!$options) {