Commit 1a2abfaaee58bda09653b24f084f1bfdf5f89e1c
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
Showing
1 changed file
with
4 additions
and
2 deletions
lib/documentmanagement/documentutil.inc.php
| @@ -61,6 +61,10 @@ require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php'); | @@ -61,6 +61,10 @@ require_once(KT_LIB_DIR . '/workflow/workflowutil.inc.php'); | ||
| 61 | class KTDocumentUtil { | 61 | class KTDocumentUtil { |
| 62 | function checkin($oDocument, $sFilename, $sCheckInComment, $oUser, $aOptions = false) { | 62 | function checkin($oDocument, $sFilename, $sCheckInComment, $oUser, $aOptions = false) { |
| 63 | $oStorage =& KTStorageManagerUtil::getSingleton(); | 63 | $oStorage =& KTStorageManagerUtil::getSingleton(); |
| 64 | + | ||
| 65 | + $sType = KTMime::getMimeTypeFromFile($sFilename); | ||
| 66 | + $iMimeTypeId = KTMime::getMimeTypeID($sType, $oDocument->getFileName()); | ||
| 67 | + | ||
| 64 | $iFileSize = filesize($sFilename); | 68 | $iFileSize = filesize($sFilename); |
| 65 | 69 | ||
| 66 | $iPreviousMetadataVersion = $oDocument->getMetadataVersionId(); | 70 | $iPreviousMetadataVersion = $oDocument->getMetadataVersionId(); |
| @@ -99,8 +103,6 @@ class KTDocumentUtil { | @@ -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 | $oDocument->setMimeTypeId($iMimeTypeId); | 106 | $oDocument->setMimeTypeId($iMimeTypeId); |
| 105 | 107 | ||
| 106 | $bSuccess = $oDocument->update(); | 108 | $bSuccess = $oDocument->update(); |