diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 3bb8adbd058..13a453cebbe 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -484,6 +484,14 @@ class Website extends CommonObject } } + if (! $error && ! empty($this->ref)) + { + global $dolibarr_main_data_root; + $pathofwebsite=$dolibarr_main_data_root.'/website/'.$this->ref; + + dol_delete_dir_recursive($pathofwebsite); + } + // Commit or rollback if ($error) { $this->db->rollback();