mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
ENHANCEMENT: removing extension from document title when uploading a new document
This commit is contained in:
parent
c708551982
commit
16d1f74b28
@ -445,7 +445,8 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
//write the filename of the stored document
|
||||
$this->Filename = $toFilename;
|
||||
$this->Folder = $toFolder;
|
||||
if (empty($this->Title)) $this->Title = $fromFilename; //don't overwrite existing document titles
|
||||
$extension = pathinfo($this->Filename, PATHINFO_EXTENSION);
|
||||
if (empty($this->Title)) $this->Title = basename($filePath,'.'.$extension); //don't overwrite existing document titles
|
||||
$this->LastChanged = SS_Datetime::now()->Rfc2822();
|
||||
|
||||
$this->write();
|
||||
|
Loading…
Reference in New Issue
Block a user