FIX : [ bug #1317 ] Removing a category does not remove all child categories
This commit is contained in:
parent
c969bc3e93
commit
df5a009aa2
@ -292,6 +292,20 @@ class Categorie
|
|||||||
|
|
||||||
$this->db->begin();
|
$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)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user