Fix autoselect of category with 'auto'

This commit is contained in:
Laurent Destailleur 2021-02-05 15:07:07 +01:00
parent dbfeba661d
commit 653fa38b06
2 changed files with 2 additions and 2 deletions

View File

@ -210,7 +210,7 @@ llxHeader("", $langs->trans("Categories"), $helpurl);
if ($user->rights->categorie->creer)
{
// Create or add
if ($action == 'create' || $_POST["addcat"] == 'addcat')
if ($action == 'create' || GETPOST("addcat") == 'addcat')
{
dol_set_focus('#label');

View File

@ -4174,7 +4174,7 @@ class Form
$output .= '<option value="-1">&nbsp;</option>';
foreach ($cate_arbo as $key => $value)
{
if ($cate_arbo[$key]['id'] == $selected || ($selected == 'auto' && count($cate_arbo) == 1))
if ($cate_arbo[$key]['id'] == $selected || ($selected === 'auto' && count($cate_arbo) == 1))
{
$add = 'selected ';
} else {