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