From 11a867c6843b540aa4e6eeb853aba41caf4ce899 Mon Sep 17 00:00:00 2001 From: jonathan_byrne Date: Mon, 7 Apr 2008 13:36:41 +0000 Subject: [PATCH] KTS-3234 "CLONE -When a document starts of as e.g. a .doc file, but the next version is a pdf file, then it remains to be seen as a Word document in some respects(SUP-675)" Fixed. Added a mimetype id change if the filename changes in the rename function. --- lib/documentmanagement/documentutil.inc.php | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) diff --git a/lib/documentmanagement/documentutil.inc.php b/lib/documentmanagement/documentutil.inc.php index c83d8ac..c3c93a9 100644 --- a/lib/documentmanagement/documentutil.inc.php +++ b/lib/documentmanagement/documentutil.inc.php @@ -1121,6 +1121,11 @@ class KTDocumentUtil { $oDocument->setModifiedUserId($oUser->getId()); $oDocument->setMinorVersionNumber($oDocument->getMinorVersionNumber()+1); $oDocument->_oDocumentContentVersion->setFilename($sNewFilename); + + $sType = KTMime::getMimeTypeFromFile($sNewFilename); + $iMimeTypeId = KTMime::getMimeTypeID($sType, $sNewFilename); + $oDocument->setMimeTypeId($iMimeTypeId); + $bSuccess = $oDocument->update(); if ($bSuccess !== true) { if (PEAR::isError($bSuccess)) { -- libgit2 0.21.4