From 95766c478795ebbd92f8989cb296570cc2894303 Mon Sep 17 00:00:00 2001 From: Guido Schratzer Date: Sat, 24 Sep 2022 20:29:06 +0300 Subject: [PATCH] FIX: Dolibarr#16476 version 2a --- htdocs/core/actions_massactions.inc.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 0cef6588839..49c825de1a3 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1382,7 +1382,6 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' // @todo : propose model selection if (!$error && $massaction == 'generate_doc' && $permissiontoread) { $db->begin(); - $objecttmp = new $objectclass($db); $nbok = 0; foreach ($toselect as $toselectid) { @@ -1390,7 +1389,6 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { if ($result > 0) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } @@ -1401,9 +1399,9 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { $newlang = $objecttmp->default_lang; // for thirdparty } if ($conf->global->MAIN_MULTILANGS && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty - $objecttmp->fetch_thirdparty(); - $newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... - } + $objecttmp->fetch_thirdparty(); + $newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... + } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang);