Save default DownloadBehaviour on a DMSDocument when initially uploading a new one

- array key check for behavior before using
This commit is contained in:
Dave Collins 2018-07-06 08:59:10 -04:00
parent 52772ae879
commit cf278fd8e2
1 changed files with 5 additions and 3 deletions

View File

@ -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