file is removed after cleaning up the database in _removeContent()

This commit is contained in:
Uwe Steinmann 2021-10-04 20:21:41 +02:00
parent a0b95e8792
commit cd061e8c2f

View File

@ -1963,10 +1963,6 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
private function _removeContent($version) { /* {{{ */
$db = $this->_dms->getDB();
if (file_exists( $this->_dms->contentDir.$version->getPath() ))
if (!SeedDMS_Core_File::removeFile( $this->_dms->contentDir.$version->getPath() ))
return false;
$db->startTransaction();
$status = $version->getStatus();
@ -2080,6 +2076,12 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
return false;
}
if (file_exists( $this->_dms->contentDir.$version->getPath() ))
if (!SeedDMS_Core_File::removeFile( $this->_dms->contentDir.$version->getPath() )) {
$db->rollbackTransaction();
return false;
}
$db->commitTransaction();
return true;
} /* }}} */