diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7f2ffb3ddad..8cca3e5defe 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4312,7 +4312,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 781a5c690cf..0508c51dfae 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)) { @@ -982,7 +982,7 @@ if ($action == 'create') { print "\n"; // Other attributes - $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid); + $parameters = array('objectsrc' => isset($objectsrc) ? $objectsrc : '', 'colspan' => ' colspan="3"', 'cols' => '3', 'socid' => $socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $expe, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -1178,7 +1178,7 @@ if ($action == 'create') { // Qty already shipped print '