mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-06-15 17:21:35 +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;
|
$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