mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 12:05:56 +00:00
ENHANCEMENT: using DMSUploadField in DMSDocument
This commit is contained in:
parent
5ac332352c
commit
449b1d3ba4
@ -424,7 +424,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
$fields->addFieldToTab('Root.Main',$fieldsTop,'Title');
|
||||
|
||||
//create upload field to replace document
|
||||
$UploadField = new UploadField('file', 'Replace file');
|
||||
$UploadField = new DMSUploadField('file', 'Replace file');
|
||||
$UploadField->setConfig('allowedMaxFileNumber', 1);
|
||||
|
||||
$fields->addFieldToTab('Root.Main',$UploadField);
|
||||
@ -500,7 +500,8 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
* @param $file File to ingest
|
||||
*/
|
||||
function ingestFile($file) {
|
||||
|
||||
$this->replaceDocument($file);
|
||||
$file->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user