Update extrafields.class.php

This commit is contained in:
Laurent Destailleur 2022-06-07 09:57:15 +02:00 committed by GitHub
parent fc26196a7f
commit 33d9c164c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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