mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Make sure default DownloadBehavior is stored when initially uploading a document
This commit is contained in:
parent
d94aa25ac7
commit
71c09244f7
@ -1003,6 +1003,18 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
||||
}
|
||||
$this->LastEditedByID = $currentUserID;
|
||||
}
|
||||
|
||||
// make sure default DownloadBehavior is respected when writing since
|
||||
$defaultDownloadBehaviour = Config::inst()->get('DMSDocument', 'default_download_behaviour');
|
||||
if ($this->DownloadBehavior == null && !empty($defaultDownloadBehaviour)) {
|
||||
$possibleBehaviors = $this->dbObject('DownloadBehavior')
|
||||
->enumValues();
|
||||
|
||||
$behavior =$possibleBehaviors[$defaultDownloadBehaviour];
|
||||
if ($behavior) {
|
||||
$this->DownloadBehavior = $behavior;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user