Skip to content
Snippets Groups Projects
Commit df5a009a authored by Cédric Gross's avatar Cédric Gross
Browse files

FIX : [ bug #1317 ] Removing a category does not remove all child categories

parent c969bc3e
No related branches found
No related tags found
No related merge requests found
......@@ -292,6 +292,20 @@ class Categorie
$this->db->begin();
/* FIX #1317 : Check for child cat and move up 1 level*/
if (! $error)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
$sql.= " SET fk_parent = ".$this->fk_parent;
$sql.= " WHERE fk_parent = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment