Merge pull request #23397 from FHenry/15_fixdelete_ecm_on_product_delete

fix: delete cem data on product deletion
This commit is contained in:
Laurent Destailleur 2023-01-04 08:12:11 +01:00 committed by GitHub
commit f32da6a28a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1408,6 +1408,14 @@ class Product extends CommonObject
}
}
// Delete record into ECM index and physically
if (!$error) {
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
if (!$res) {
$error++;
}
}
if (!$error) {
// We remove directory
$ref = dol_sanitizeFileName($this->ref);