Merge pull request #11127 from Supermanu/del_proj_cat

FIX: Remove link between categories and project when deleting
This commit is contained in:
Laurent Destailleur 2019-05-04 12:52:35 +02:00 committed by GitHub
commit 92534cc101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -688,6 +688,18 @@ class Project extends CommonObject
}
}
// Remove linked categories.
if (! $error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX. "categorie_project";
$sql.= " WHERE fk_project = ". $this->id;
$result = $this->db->query($sql);
if (! $result) {
$error++;
$this->errors[] = $this->db->lasterror();
}
}
// Fetch tasks
$this->getLinesArray($user);