mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX : [ bug #1317 ] Removing a category does not remove all child categories
This commit is contained in:
parent
ab6a67054a
commit
a4797a0e4a
|
|
@ -290,6 +290,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";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user