diff --git a/lib/documentmanagement/documentutil.inc.php b/lib/documentmanagement/documentutil.inc.php index b13fc6e..fb78a14 100644 --- a/lib/documentmanagement/documentutil.inc.php +++ b/lib/documentmanagement/documentutil.inc.php @@ -72,8 +72,16 @@ class KTDocumentUtil { } KTDocumentUtil::copyMetadata($oDocument, $iPreviousMetadataVersion); + + $md5hash = md5_file($sFilename); + $content = $oDocument->_oDocumentContentVersion; + $content->setStorageHash($md5hash); + $content->update(); - if (!$oStorage->upload($oDocument, $sFilename)) { + if (empty($aOptions)) $aOptions = array(); + $aOptions['md5hash'] = $md5hash; + + if (!$oStorage->upload($oDocument, $sFilename, $aOptions)) { return PEAR::raiseError(_kt('An error occurred while storing the new file')); }