Fix: commit at wrong place

This commit is contained in:
Laurent Destailleur 2012-04-15 18:51:42 +02:00
parent f9b2f29547
commit 5169437c2d

View File

@ -368,16 +368,14 @@ class Task extends CommonObject
} }
else else
{ {
$this->db->commit();
$this->db->free($resql); $this->db->free($resql);
//Delete associated link file //Delete associated link file
if ($conf->projet->dir_output) if ($conf->projet->dir_output)
{ {
$projectstatic=new Project($this->db); $projectstatic=new Project($this->db);
$projectstatic->fetch($this->fk_project); $projectstatic->fetch($this->fk_project);
$dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref) . '/' . dol_sanitizeFileName($this->id); $dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($projectstatic->ref) . '/' . dol_sanitizeFileName($this->id);
dol_syslog(get_class($this)."::delete dir=".$dir, LOG_DEBUG); dol_syslog(get_class($this)."::delete dir=".$dir, LOG_DEBUG);
if (file_exists($dir)) if (file_exists($dir))
@ -392,8 +390,10 @@ class Task extends CommonObject
} }
} }
} }
return 1; $this->db->commit();
return 1;
} }
} }