From 92e7a03dc43858f46bdcb8c81b73cd5bc7c271b7 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Thu, 21 May 2026 22:12:17 +0200 Subject: [PATCH] Fix : product weight default selection (#38374) --- htdocs/product/class/html.formproduct.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index f265f65af6e..c7219ece947 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -619,11 +619,12 @@ class FormProduct $return .= '"'; if ($mode == 1 && $lines->short_label == $selected) { $return .= ' selected'; - } elseif ($mode == 2 && $lines->scale == $selected) { + } elseif ($mode == 2 && (int) $lines->scale === (int) $selected) { // Careful null !== 0 !== '0' and when 0 is saved bdd store null $return .= ' selected'; } elseif ($mode == 0 && $lines->id == $selected) { $return .= ' selected'; } + $return .= '>'; if ($measuring_style == 'time') { $return .= $langs->trans(ucfirst((string) $lines->label));