From d8e6ce1ae82741cbb1a6027d032a30d28fcbb6e8 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Fri, 3 Jun 2022 16:06:25 +0200 Subject: [PATCH] FIX - php V8 warning class commonobject extrafields --- htdocs/core/class/commonobject.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6da88e55cd0..b39facd16a4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8000,7 +8000,11 @@ abstract class CommonObject } // Convert float submited string into real php numeric (value in memory must be a php numeric) if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('price', 'double'))) { - $value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) || $value) ? price2num($value) : $this->array_options['options_'.$key]; + if (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) || $value) { + $value = price2num($value); + } elseif (isset($this->array_options['options_'.$key])) { + $value = $this->array_options['options_'.$key]; + } } // HTML, text, select, integer and varchar: take into account default value in database if in create mode