mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Save default DownloadBehaviour on a DMSDocument when initially uploading a new one
- array key check for behavior before using
This commit is contained in:
parent
52772ae879
commit
cf278fd8e2
@ -1011,12 +1011,14 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
||||
$possibleBehaviors = $this->dbObject('DownloadBehavior')
|
||||
->enumValues();
|
||||
|
||||
if (array_key_exists($defaultDownloadBehaviour, $possibleBehaviors)) {
|
||||
$behavior = $possibleBehaviors[$defaultDownloadBehaviour];
|
||||
if ($behavior) {
|
||||
$this->DownloadBehavior = $behavior;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the relative URL of an icon for the file type, based on the
|
||||
|
Loading…
Reference in New Issue
Block a user