Merge pull request #22800 from frederic34/ecmfilesextrafieldsdelete

delete extrafields when deleting ecmfiles
This commit is contained in:
Laurent Destailleur 2022-11-09 15:06:10 +01:00 committed by GitHub
commit b19bb4447a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -751,7 +751,13 @@ class EcmFiles extends CommonObject
}
// If you need to delete child tables to, you can insert them here
if (!$error) {
$result = $this->deleteExtraFields();
if (!$result) {
dol_syslog(get_class($this)."::delete error ".$this->error, LOG_ERR);
$error++;
}
}
if (!$error) {
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element;
$sql .= ' WHERE rowid='.((int) $this->id);