Merge pull request #17938 from atm-kevin/FIX_13.0_Ticket_Card

Fix : Fatal error on ticket presend
This commit is contained in:
Laurent Destailleur 2021-06-15 22:08:03 +02:00 committed by GitHub
commit dea8c8d32f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1305,10 +1305,14 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) {
} elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$arrayoffamiliestoexclude = array('objectamount');
$action = 'add_message'; // action to use to post the message
@ -1317,7 +1321,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action =
// Substitution array
$morehtmlright = '';
$help = "";
$substitutionarray = getCommonSubstitutionArray($newlang, 0, $arrayoffamiliestoexclude, $object);
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object);
if ($object->fk_soc > 0) {
$substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name;
}