mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 12:05:56 +00:00
ENHANCEMENT: deleting the old file when replacing, if document versioning is turned off
This commit is contained in:
parent
408fd88d9e
commit
18c2081be7
@ -444,6 +444,9 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
//version the existing file (copy it to a new "very specific" filename
|
||||
if (DMSDocument_versions::$enable_versions) {
|
||||
DMSDocument_versions::create_version($this);
|
||||
} else { //otherwise delete the old document file
|
||||
$oldPath = $this->getFullPath();
|
||||
if (file_exists($oldPath)) unlink($this->getFullPath());
|
||||
}
|
||||
|
||||
copy($fromPath, $toPath); //this will overwrite the existing file (if present)
|
||||
|
Loading…
x
Reference in New Issue
Block a user