Fix: Renaming a project with uplaoded files failed.

This commit is contained in:
Laurent Destailleur 2014-06-21 15:45:53 +02:00
parent 76532218c2
commit d19b34cc7e
3 changed files with 7 additions and 5 deletions

View File

@ -3,6 +3,7 @@ English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 3.5.4 compared to 3.5.3 ***** ***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Renaming a project with uplaoded files failed.
Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error. Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error.
Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin. Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin.
Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order. Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order.

View File

@ -547,7 +547,7 @@ class Product extends CommonObject
if (file_exists($olddir)) if (file_exists($olddir))
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$res=@dol_move($olddir, $newdir); $res=dol_move($olddir, $newdir);
if (! $res) if (! $res)
{ {
$this->error='ErrorFailToMoveDir'; $this->error='ErrorFailToMoveDir';

View File

@ -247,8 +247,9 @@ class Project extends CommonObject
$newdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($this->ref); $newdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($this->ref);
if (file_exists($olddir)) if (file_exists($olddir))
{ {
$res=@dol_move($olddir, $newdir); include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
if (! $res) $res=dol_move($olddir, $newdir);
if (! $res)
{ {
$this->error='ErrorFailToMoveDir'; $this->error='ErrorFailToMoveDir';
$error++; $error++;
@ -511,7 +512,7 @@ class Project extends CommonObject
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields"; $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields";
$sql.= " WHERE fk_object=" . $this->id; $sql.= " WHERE fk_object=" . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -556,7 +557,7 @@ class Project extends CommonObject
// End call triggers // End call triggers
} }
} }
if (empty($error)) { if (empty($error)) {
$this->db->commit(); $this->db->commit();
return 1; return 1;