mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 12:05:56 +00: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')
|
$possibleBehaviors = $this->dbObject('DownloadBehavior')
|
||||||
->enumValues();
|
->enumValues();
|
||||||
|
|
||||||
|
if (array_key_exists($defaultDownloadBehaviour, $possibleBehaviors)) {
|
||||||
$behavior = $possibleBehaviors[$defaultDownloadBehaviour];
|
$behavior = $possibleBehaviors[$defaultDownloadBehaviour];
|
||||||
if ($behavior) {
|
if ($behavior) {
|
||||||
$this->DownloadBehavior = $behavior;
|
$this->DownloadBehavior = $behavior;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the relative URL of an icon for the file type, based on the
|
* Return the relative URL of an icon for the file type, based on the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user