diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index b4eddcc252f..9d18fccf423 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1279,7 +1279,7 @@ abstract class CommonDocGenerator $extrafieldOptionsKey = $extrafieldsKeyPrefix.$extrafieldKey; - // Load extrafiels if not allready does + // Load extra fields if they haven't been loaded already. if (empty($this->extrafieldsCache)) { $this->extrafieldsCache = new ExtraFields($this->db); } @@ -1605,7 +1605,7 @@ abstract class CommonDocGenerator return 0; } - // Load extrafiels if not allready does + // Load extra fields if they haven't been loaded already. if (empty($this->extrafieldsCache)) { $this->extrafieldsCache = new ExtraFields($this->db); } @@ -1615,7 +1615,7 @@ abstract class CommonDocGenerator $extrafields = $this->extrafieldsCache; - if (!empty($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) { + if (!empty($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]) && array_key_exists('label', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { // Dont display separator yet even is set to be displayed (not compatible yet) if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') {