Commit 1a2abfaaee58bda09653b24f084f1bfdf5f89e1c

Authored by megan_w
1 parent ae4d8fe0

KTS-3388

"Warning on checkin from mime.inc.php on line 146"
Fixed. Moved the mime type check to the top of the checkin function.

Committed by: Megan Watson
Reviewed by: Jonathan Byrne



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.2c-Release-Branch@8520 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/documentutil.inc.php
... ... @@ -61,6 +61,10 @@ require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php');
61 61 class KTDocumentUtil {
62 62 function checkin($oDocument, $sFilename, $sCheckInComment, $oUser, $aOptions = false) {
63 63 $oStorage =& KTStorageManagerUtil::getSingleton();
  64 +
  65 + $sType = KTMime::getMimeTypeFromFile($sFilename);
  66 + $iMimeTypeId = KTMime::getMimeTypeID($sType, $oDocument->getFileName());
  67 +
64 68 $iFileSize = filesize($sFilename);
65 69  
66 70 $iPreviousMetadataVersion = $oDocument->getMetadataVersionId();
... ... @@ -99,8 +103,6 @@ class KTDocumentUtil {
99 103 }
100 104 }
101 105  
102   - $sType = KTMime::getMimeTypeFromFile($sFilename);
103   - $iMimeTypeId = KTMime::getMimeTypeID($sType, $oDocument->getFileName());
104 106 $oDocument->setMimeTypeId($iMimeTypeId);
105 107  
106 108 $bSuccess = $oDocument->update();
... ...