From b3b52a9f359cdc6ae862c5b290c2289585dcf3ed Mon Sep 17 00:00:00 2001 From: Megan Watson Date: Wed, 26 Mar 2008 07:15:30 +0000 Subject: [PATCH] KTS-3190 ""Import from server location" should also remove the file extension from the document name" Fixed. Document add now drops the extension from the filename if it is used for the document title. --- lib/documentmanagement/documentutil.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/documentmanagement/documentutil.inc.php b/lib/documentmanagement/documentutil.inc.php index d3111a1..c83d8ac 100644 --- a/lib/documentmanagement/documentutil.inc.php +++ b/lib/documentmanagement/documentutil.inc.php @@ -237,7 +237,13 @@ class KTDocumentUtil { //$oContents = KTUtil::arrayGet($aOptions, 'contents'); $aMetadata = KTUtil::arrayGet($aOptions, 'metadata', null, false); $oDocumentType = KTUtil::arrayGet($aOptions, 'documenttype'); - $sDescription = KTUtil::arrayGet($aOptions, 'description', $sFilename); + $sDescription = KTUtil::arrayGet($aOptions, 'description', ''); + + if(empty($sDescription)){ + // If no document name is provided use the filename minus the extension + $aFile = pathinfo($sFilename); + $sDescription = (isset($aFile['filename']) && !empty($aFile['filename'])) ? $aFile['filename'] : $sFilename; + } $oUploadChannel =& KTUploadChannel::getSingleton(); -- libgit2 0.21.4