Merge pull request #21125 from bb2a/FIX---php-V8-warning-class-extrafields

FIX - php V8 warning class extrafields
This commit is contained in:
Laurent Destailleur 2022-06-07 09:58:50 +02:00 committed by GitHub
commit 07f4ebf8b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1671,13 +1671,15 @@ class ExtraFields
}
} else {
$translabel = '';
if (!empty($obj->{$InfoFieldList[1]})) {
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
$tmppropname = $InfoFieldList[1];
//$obj->$tmppropname = '';
if (!empty(isset($obj->$tmppropname) ? $obj->$tmppropname : '')) {
$translabel = $langs->trans($obj->$tmppropname);
}
if ($translabel != $obj->{$InfoFieldList[1]}) {
if ($translabel != (isset($obj->$tmppropname) ? $obj->$tmppropname : '')) {
$value = dol_trunc($translabel, 18);
} else {
$value = $obj->{$InfoFieldList[1]};
$value = isset($obj->$tmppropname) ? $obj->$tmppropname : '';
}
}
} else {