fix common delete (#36167)

This commit is contained in:
Frédéric FRANCE
2025-11-08 11:57:22 +01:00
committed by GitHub
parent 4ee6aebbbf
commit 936b3cddfb
2 changed files with 4 additions and 0 deletions

View File

@@ -11054,6 +11054,7 @@ abstract class CommonObject
if (!$error) {
$dir = getMultidirOutput($this)."/".dol_sanitizeFileName($this->ref);
// For remove dir
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
if (dol_is_dir($dir)) {
if (!dol_delete_dir_recursive($dir)) {
$this->errors[] = 'ErrorFailToDeleteDir';

View File

@@ -158,6 +158,9 @@ function getMultidirOutput($object, $module = '', $forobject = 0, $mode = 'outpu
} elseif ($module == 'recruitmentcandidature') {
$module = 'recruitment';
$subdirectory = '/recruitmentcandidature';
} elseif ($module == 'knowledgerecord') {
$module = 'knowledgemanagement';
$subdirectory = '/knowledgerecord';
}
// Get the relative path of directory