diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4a95bb7d345..be7e8f2ec6e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4291,7 +4291,7 @@ abstract class CommonObject if ($elementTable == 'commande_fournisseur_dispatch') { $fieldstatus = "status"; } - if (is_array($this->fields) && array_key_exists('status', $this->fields)) { + if (isset($this->fields) && is_array($this->fields) && array_key_exists('status', $this->fields)) { $fieldstatus = 'status'; } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3c33c913384..384f2cdde3d 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -429,10 +429,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) {