FIX fatal error with bad definition of dictionaries

This commit is contained in:
Laurent Destailleur
2023-08-31 00:04:07 +02:00
parent bb36521c3d
commit dcd751aa47

View File

@@ -1674,6 +1674,9 @@ if ($id > 0) {
}
if (in_array($value, array('label', 'libelle', 'libelle_facture')) && empty($tabcomplete[$tabname[$id]]['help'][$value])) {
if (!is_array($tabcomplete[$tabname[$id]]['help'])) { // protection when $tabcomplete[$tabname[$id]]['help'] is a an empty string, we must force it into an array
$tabcomplete[$tabname[$id]]['help'] = array();
}
$tabcomplete[$tabname[$id]]['help'][$value] = $langs->trans('LabelUsedByDefault');
}