Commit df3f5e2b5b8d88c1fa152d0a1a323c724f487273

Authored by jalaloedien
1 parent 33c6869d

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

Committed By: Jalaloedien Abrahams
Reviewed By: Jonathan Byrne

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8414 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/documentutil.inc.php
... ... @@ -72,8 +72,16 @@ class KTDocumentUtil {
72 72 }
73 73  
74 74 KTDocumentUtil::copyMetadata($oDocument, $iPreviousMetadataVersion);
  75 +
  76 + $md5hash = md5_file($sFilename);
  77 + $content = $oDocument->_oDocumentContentVersion;
  78 + $content->setStorageHash($md5hash);
  79 + $content->update();
75 80  
76   - if (!$oStorage->upload($oDocument, $sFilename)) {
  81 + if (empty($aOptions)) $aOptions = array();
  82 + $aOptions['md5hash'] = $md5hash;
  83 +
  84 + if (!$oStorage->upload($oDocument, $sFilename, $aOptions)) {
77 85 return PEAR::raiseError(_kt('An error occurred while storing the new file'));
78 86 }
79 87  
... ...