From d19b34cc7ee1c1f16a7b1d8c3bd3bac36e82b9f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Jun 2014 15:45:53 +0200 Subject: [PATCH] Fix: Renaming a project with uplaoded files failed. --- ChangeLog | 1 + htdocs/product/class/product.class.php | 2 +- htdocs/projet/class/project.class.php | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 089b498acfa..55cc3594ac3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ English Dolibarr ChangeLog -------------------------------------------------------------- ***** 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 #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. diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 934706a1c95..d7d5952ab66 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -547,7 +547,7 @@ class Product extends CommonObject if (file_exists($olddir)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $res=@dol_move($olddir, $newdir); + $res=dol_move($olddir, $newdir); if (! $res) { $this->error='ErrorFailToMoveDir'; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 43e2137715c..7ceb6a8438c 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -247,8 +247,9 @@ class Project extends CommonObject $newdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { - $res=@dol_move($olddir, $newdir); - if (! $res) + include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + $res=dol_move($olddir, $newdir); + if (! $res) { $this->error='ErrorFailToMoveDir'; $error++; @@ -511,7 +512,7 @@ class Project extends CommonObject $sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields"; $sql.= " WHERE fk_object=" . $this->id; - + dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); @@ -556,7 +557,7 @@ class Project extends CommonObject // End call triggers } } - + if (empty($error)) { $this->db->commit(); return 1;