Update commonobject.class.php

This commit is contained in:
Laurent Destailleur 2022-07-03 12:35:44 +02:00 committed by GitHub
parent 31c39226d6
commit 9328e89c15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6843,15 +6843,15 @@ abstract class CommonObject
if ((!isset($this->fields[$key]['default'])) || ($this->fields[$key]['notnull'] != 1)) {
$out .= '<option value="0">&nbsp;</option>';
}
foreach ($param['options'] as $index => $val) {
if ((string) $index == '') {
foreach ($param['options'] as $keyb => $valb) {
if ((string) $keyb == '') {
continue;
}
if (strpos($val, "|") !== false) list($val, $parent) = explode('|', $val);
$out .= '<option value="'.$index.'"';
$out .= (((string) $value == (string) $index) ? ' selected' : '');
if (strpos($valb, "|") !== false) list($valb, $parent) = explode('|', $valb);
$out .= '<option value="'.$keyb.'"';
$out .= (((string) $value == (string) $keyb) ? ' selected' : '');
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
$out .= '>'.$val.'</option>';
$out .= '>'.$valb.'</option>';
}
$out .= '</select>';
} elseif ($type == 'sellist') {