Minor BugFix : Missing delete Category Multilangual fields
Delete of Multilangual fields was missing, impossible to delete category. Fixed Error : Cannot delete or update a parent row: a foreign key constraint fails (`Dol-3.6`.`llx_categorie_lang`, CONSTRAINT `fk_category_lang_fk_category` FOREIGN KEY (`fk_category`) REFERENCES `llx_categorie` (`rowid`))
This commit is contained in:
parent
f178aa65ca
commit
8fc5faf4a8
@ -408,6 +408,17 @@ class Categorie extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
|
||||||
|
$sql .= " WHERE fk_category = ".$this->id;
|
||||||
|
if (!$this->db->query($sql))
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Delete category
|
// Delete category
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user