Merge pull request #14789 from bafbes/abb120144

fix:remove deleted user params
This commit is contained in:
Laurent Destailleur 2020-09-20 17:12:15 +02:00 committed by GitHub
commit b4137392ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1038,6 +1038,14 @@ class User extends CommonObject
$this->error = $this->db->lasterror();
}
// Remove params
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_param WHERE fk_user = ".$this->id;
if (!$error && !$this->db->query($sql))
{
$error++;
$this->error = $this->db->lasterror();
}
// If contact, remove link
if ($this->contact_id > 0)
{