Update contact.class.php (#30867)

When creating a customer and a contact at the same time if in the third-party settings the default role assignment option is empty (not filled in) an SQL error occurs.
This commit is contained in:
Sylvain Legrand
2024-09-06 14:51:50 +03:00
committed by Laurent Destailleur
parent 0708244908
commit aaa0128884

View File

@@ -1893,6 +1893,9 @@ class Contact extends CommonObject
} else {
if (count($this->roles) > 0) {
foreach ($this->roles as $keyRoles => $valRoles) {
if (empty($valRoles)) {
continue;
}
$idrole = 0;
if (is_array($valRoles)) {
$idrole = $valRoles['id'];