Fix : product weight default selection (#38374)

This commit is contained in:
John BOTELLA 2026-05-21 22:12:17 +02:00 committed by GitHub
parent 1213bccb24
commit 92e7a03dc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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));