From c538dfb5b2b9b9458aca9ab1d8f09cd361c96d11 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Sep 2020 10:34:44 +0200 Subject: [PATCH] FIX #14646 --- htdocs/user/class/usergroup.class.php | 12 ++++-------- htdocs/user/group/card.php | 2 -- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index dad0d724f08..5b58bd06a41 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -624,13 +624,11 @@ class UserGroup extends CommonObject global $user, $conf; $this->datec = dol_now(); - if (empty($this->nom) && !empty($this->name)) { - $this->nom = $this->name; + if (!empty($this->name)) { + $this->nom = $this->name; // Field for 'name' is called 'nom' in database } if (!isset($this->entity)) $this->entity = $conf->entity; // If not defined, we use default value - $entity = $this->entity; - if (!empty($conf->multicompany->enabled) && $conf->entity == 1) $entity = $this->entity; return $this->createCommon($user, $notrigger); } @@ -645,10 +643,8 @@ class UserGroup extends CommonObject { global $user, $conf; - $entity = $conf->entity; - if (!empty($conf->multicompany->enabled) && $conf->entity == 1) - { - $entity = $this->entity; + if (!empty($this->name)) { + $this->nom = $this->name; // Field for 'name' is called 'nom' in database } return $this->updateCommon($user, $notrigger); diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index d6d3fdcc4a1..102fc61d5c1 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -130,7 +130,6 @@ if (empty($reshook)) { $action = "create"; // Go back to create page } else { $object->name = GETPOST("nom", 'nohtml'); - //$object->nom = $object->name; // For backward compatibility $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none'))); // Fill array 'array_options' with data from add form @@ -205,7 +204,6 @@ if (empty($reshook)) { $object->oldcopy = clone $object; $object->name = GETPOST("nom", 'nohtml'); - //$object->nom = $object->name; // For backward compatibility $object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'none'))); // Fill array 'array_options' with data from add form