Fix php 8 error

if empty value, there is an error when doc is generated
This commit is contained in:
ptibogxiv 2023-01-08 21:30:12 +01:00 committed by GitHub
parent ce1e6dd9bd
commit 23013282ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1288,7 +1288,8 @@ abstract class CommonDocGenerator
}
$extrafields = $this->extrafieldsCache;
$extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element);
$extrafieldOutputContent = '';
if (isset($object->array_options[$extrafieldOptionsKey])) $extrafieldOutputContent = $extrafields->showOutputField($extrafieldKey, $object->array_options[$extrafieldOptionsKey], '', $object->table_element);
// TODO : allow showOutputField to be pdf public friendly, ex: in a link to object, clean getNomUrl to remove link and images... like a getName methode ...
if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'link') {