FIX Language selection lost if error during creation of email template

This commit is contained in:
Laurent Destailleur 2018-08-22 13:23:46 +02:00
parent c20d556265
commit de2cdfc70f

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
@ -989,7 +989,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
print '<td>';
if (! empty($conf->global->MAIN_MULTILANGS))
{
$selectedlang = $langs->defaultlang;
$selectedlang = GETPOSTISSET('langcode','aZ09')?GETPOST('langcode','aZ09'):$langs->defaultlang;
if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]};
print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150');
}