Skip to content

Commit

Permalink
Fix: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9)
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Jan 15, 2016
1 parent c65babf commit 905f9d7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions htdocs/fourn/commande/card.php
Expand Up @@ -2,7 +2,7 @@
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
Expand Down Expand Up @@ -121,7 +121,7 @@

if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
{

$result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
if ($result < 0) dol_print_error($db, $object->error);
else $object->ref_supplier=GETPOST('ref_supplier','alpha'); // ADD : ref_supplier to object property, otherwise not visibly updated on change
Expand Down Expand Up @@ -615,6 +615,14 @@
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
Expand Down

0 comments on commit 905f9d7

Please sign in to comment.