From 826c2149c5a74b437cbd12815da77fb9ff0d3f7a Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 5 Dec 2024 11:30:08 -0700 Subject: [PATCH] Fix some numeric customfields causing conversion/formatting problems --- api/src/Storage/Merge.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index 396b8e4b5f..d3f67c3531 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -1426,6 +1426,10 @@ abstract class Merge { foreach($this->numeric_fields as $fieldname) { + if(!array_key_exists($fieldname, $replacements)) + { + continue; + } $names[] = preg_quote($fieldname, '/'); $raw_placeholder = $this->prefix("", $fieldname . '_-raw-', '$'); if(!array_key_exists($raw_placeholder, $replacements)) @@ -3052,7 +3056,7 @@ abstract class Merge */ static public function number_format($number, $num_decimal_places = 2, $_mimetype = '') { - if((string)$number === '') + if(is_null($number) || (string)$number === '') { return ''; }