Skip to content

Commit

Permalink
Minor BugFix : Missing delete Category Multilangual fields
Browse files Browse the repository at this point in the history
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`))
  • Loading branch information
BadPixxel committed Nov 10, 2014
1 parent f178aa6 commit 8fc5faf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion htdocs/categories/class/categorie.class.php
Expand Up @@ -408,7 +408,18 @@ function delete($user)
$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
if (! $error)
{
Expand Down

0 comments on commit 8fc5faf

Please sign in to comment.