From f4cbc81c97adb6833f116f4a77fc205b0994c7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 14 Oct 2015 20:13:14 +0200 Subject: [PATCH 1/2] Bad chmod for directory when changing ref When changing product ref, the old document directory is renamed and chmod 0664 in place of 0775 --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 41bc2520d8f..d90b87719e4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -766,7 +766,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, '0775'); if (! $res) { $this->error='ErrorFailToMoveDir'; From 3638f17d75eabf6a56a8ad0edca8b127534dd3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 14 Oct 2015 22:28:03 +0200 Subject: [PATCH 2/2] Update product.class.php --- htdocs/product/class/product.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d90b87719e4..aaf4126d76a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -765,8 +765,10 @@ class Product extends CommonObject $newdir = $conf->product->dir_output . "/" . dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $res = dol_move($olddir, $newdir, '0775'); + //include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + //$res = dol_move($olddir, $newdir); + // do not use dol_move with directory + $res = @rename($olddir, $newdir); if (! $res) { $this->error='ErrorFailToMoveDir';