FIX avoid odt errors (#31126)

This commit is contained in:
Regis Houssin 2024-09-25 22:52:25 +02:00 committed by GitHub
parent ef5f56ddf4
commit 28df02f039
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -346,6 +346,10 @@ abstract class CommonDocGenerator
// phpcs:enable
global $extrafields;
if (!is_object($object)) {
return array();
}
if (empty($object->country) && !empty($object->country_code)) {
$object->country = $outputlangs->transnoentitiesnoconv("Country".$object->country_code);
}
@ -954,7 +958,7 @@ abstract class CommonDocGenerator
// phpcs:enable
global $conf;
if (is_array($extrafields->attributes[$object->table_element]['label'])) {
if (isset($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) {
$formatedarrayoption = $object->array_options;