Fix update default contact type
This commit is contained in:
parent
93ca27d808
commit
7e8d06e8b8
@ -400,9 +400,7 @@ if (empty($reshook))
|
||||
$object->note_public = (string) GETPOST("note_public", 'restricthtml');
|
||||
$object->note_private = (string) GETPOST("note_private", 'restricthtml');
|
||||
|
||||
if (GETPOSTISSET("roles")) {
|
||||
$object->roles = GETPOST("roles", 'array');
|
||||
}
|
||||
$object->roles = GETPOST("roles", 'array'); // Note GETPOSTISSET("role") is null when combo is empty
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
|
||||
@ -1747,14 +1747,14 @@ class Contact extends CommonObject
|
||||
if (count($this->roles) > 0) {
|
||||
foreach ($this->roles as $keyRoles => $valRoles) {
|
||||
$idrole = 0;
|
||||
if (is_array($idrole)) {
|
||||
if (is_array($valRoles)) {
|
||||
$idrole = $valRoles['id'];
|
||||
} else {
|
||||
$idrole = $valRoles;
|
||||
}
|
||||
|
||||
$socid = 0;
|
||||
if (is_array($idrole)) {
|
||||
if (is_array($valRoles)) {
|
||||
$socid = $valRoles['socid'];
|
||||
} else {
|
||||
$socid = $this->socid;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user