From df3f5e2b5b8d88c1fa152d0a1a323c724f487273 Mon Sep 17 00:00:00 2001 From: jalaloedien Date: Mon, 5 May 2008 07:24:48 +0000 Subject: [PATCH] KTS-3328 "MD5 hash is not being updated or stored for documents that are checked in" Fixed. Added md5 hash update to documentutil.inc.php --- lib/documentmanagement/documentutil.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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')); } -- libgit2 0.21.4