From 726b899d30e4defe41113f79d765287254e19554 Mon Sep 17 00:00:00 2001 From: Quentin-Seekness <72733832+Quentin-Seekness@users.noreply.github.com> Date: Fri, 29 Apr 2022 10:45:08 +0200 Subject: [PATCH] FIX: Delete an extrafield where type is double Found the bug on a propal's extrafield, it was impossible to delete a decimal extrafield. In updateExtraField() the $value stayed "" where it needed to be null. The same issue can be found in insertExtraFields(). --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 272d66e4855..aa88aeb825a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5999,7 +5999,7 @@ abstract class CommonObject $this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel); return -1; } elseif ($value == '') { - $new_array_options[$key] = null; + $value = null; } //dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG); $new_array_options[$key] = $value; @@ -6365,7 +6365,7 @@ abstract class CommonObject $this->errors[] = $langs->trans("ExtraFieldHasWrongValue", $attributeLabel); return -1; } elseif ($value === '') { - $this->array_options["options_".$key] = null; + $value = null; } //dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG); $this->array_options["options_".$key] = $value;