From: Robert J. Lang Date: Tue, 18 May 2021 22:26:41 +0000 (-0700) Subject: Fix mandatory keys check fail for value of float 0.0 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=13a474d538f543263907572df60d4fc2a50be3c8;p=civicrm-core.git Fix mandatory keys check fail for value of float 0.0 --- diff --git a/api/v3/utils.php b/api/v3/utils.php index f67ada4890..5919fb592b 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -89,7 +89,7 @@ function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = [], $ve else { // Disallow empty values except for the number zero. // TODO: create a utility for this since it's needed in many places. - if (!array_key_exists($key, $params) || (empty($params[$key]) && $params[$key] !== 0 && $params[$key] !== '0')) { + if (!array_key_exists($key, $params) || (empty($params[$key]) && $params[$key] !== 0.0 && $params[$key] !== '0')) { $unmatched[] = $key; } }