merge from 12.0 because this bug comme from it

This commit is contained in:
Florian HENRY 2021-01-12 21:48:34 +01:00
commit 1cc88794b5
2 changed files with 7 additions and 1 deletions

View File

@ -35,7 +35,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
{
$mode_search = 0;
if (in_array($typ, array('int', 'double', 'real', 'price'))) $mode_search = 1; // Search on a numeric
if (in_array($typ, array('sellist', 'link')) && $crit != '0' && $crit != '-1' && !is_string($crit)) $mode_search = 2; // Search on a foreign key int
if (in_array($typ, array('sellist', 'link')) && $crit != '0' && $crit != '-1' && is_numeric($crit)) $mode_search = 2; // Search on a foreign key int
if (in_array($typ, array('sellist')) && is_string($crit)) $mode_search = 0;// Search on a foreign key string
if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search = 4; // Search on a multiselect field with sql type = text
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string

View File

@ -660,6 +660,12 @@ class UserGroup extends CommonObject
$this->nom = $this->name; // Field for 'name' is called 'nom' in database
}
$entity = $conf->entity;
if (!empty($conf->multicompany->enabled) && $conf->entity == 1)
{
$entity = $this->entity;
}
return $this->updateCommon($user, $notrigger);
}