mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Merge pull request #24 from ss23/master
FIX Don't show the upload field when inappropriate
This commit is contained in:
commit
c2639d86d1
@ -57,6 +57,15 @@ class DMSUploadField extends UploadField {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function isDisabled() {
|
||||
return (parent::isDisabled() || !$this->isSaveable());
|
||||
}
|
||||
|
||||
public function isSaveable() {
|
||||
return (!empty($this->getRecord()->ID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Action to handle upload of a single file
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user