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,9 +1011,11 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
|||
$possibleBehaviors = $this->dbObject('DownloadBehavior')
|
||||
->enumValues();
|
||||
|
||||
$behavior = $possibleBehaviors[$defaultDownloadBehaviour];
|
||||
if ($behavior) {
|
||||
$this->DownloadBehavior = $behavior;
|
||||
if (array_key_exists($defaultDownloadBehaviour, $possibleBehaviors)) {
|
||||
$behavior = $possibleBehaviors[$defaultDownloadBehaviour];
|
||||
if ($behavior) {
|
||||
$this->DownloadBehavior = $behavior;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue