Merge pull request #23813 from grandoc/new_branch_06_02_2023

fix : Warning: Attempt to read property default_lang on null in /home…
This commit is contained in:
Laurent Destailleur 2023-02-10 19:50:06 +01:00 committed by GitHub
commit afbb612b41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1190,7 +1190,9 @@ if (empty($reshook)) {
$outputlangs = $langs;
$newlang = GETPOST('lang_id', 'alpha');
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
$user = new User($db);
$user->fetch($object->fk_user_author);
$newlang = $user->lang;
}
if (!empty($newlang)) {
$outputlangs = new Translate("", $conf);