Commit e7f0bcaeb9c824f30ddcb27cb0fa42a004e1afda

Authored by kevin_fourie
1 parent 9b6379df

Reverted...

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

KTS-3240
"Add MD5 hash to assist with validation of repository storage"

Committed By: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.2c-Release-Branch@8456 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/documentcontentversion.inc.php
... ... @@ -61,8 +61,6 @@ class KTDocumentContentVersion extends KTEntity {
61 61 /** Where in the storage this file can be found */
62 62 var $sStoragePath;
63 63  
64   - var $md5hash;
65   -
66 64 var $_aFieldToSelect = array(
67 65 "iId" => "id",
68 66  
... ... @@ -74,7 +72,6 @@ class KTDocumentContentVersion extends KTEntity {
74 72 "iMajorVersion" => 'major_version',
75 73 "iMinorVersion" => 'minor_version',
76 74 "sStoragePath" => 'storage_path',
77   - 'md5hash' => 'md5hash'
78 75 );
79 76  
80 77 function KTDocumentContentVersion() {
... ... @@ -82,7 +79,6 @@ class KTDocumentContentVersion extends KTEntity {
82 79  
83 80 function getFileName() { return $this->sFileName; }
84 81 function setFileName($sNewValue) { $this->sFileName = $sNewValue; }
85   - function getDocumentId() { return $this->iDocumentId; }
86 82 function getFileSize() { return $this->iSize; }
87 83 function setFileSize($iNewValue) { $this->iSize = $iNewValue; }
88 84 function getSize() { return $this->iSize; }
... ... @@ -95,8 +91,6 @@ class KTDocumentContentVersion extends KTEntity {
95 91 function setMinorVersionNumber($iNewValue) { $this->iMinorVersion = $iNewValue; }
96 92 function getStoragePath() { return $this->sStoragePath; }
97 93 function setStoragePath($sNewValue) { $this->sStoragePath = $sNewValue; }
98   - function getStorageHash() { return $this->md5hash; }
99   - function setStorageHash($sNewValue) { $this->md5hash = $sNewValue; }
100 94  
101 95 function getVersion() {
102 96 return sprintf("%s.%s", $this->getMajorVersionNumber(), $this->getMinorVersionNumber());
... ...
lib/documentmanagement/documentutil.inc.php
... ... @@ -71,16 +71,8 @@ class KTDocumentUtil {
71 71 }
72 72  
73 73 KTDocumentUtil::copyMetadata($oDocument, $iPreviousMetadataVersion);
74   -
75   - $md5hash = md5_file($sFilename);
76   - $content = $oDocument->_oDocumentContentVersion;
77   - $content->setStorageHash($md5hash);
78   - $content->update();
79 74  
80   - if (empty($aOptions)) $aOptions = array();
81   - $aOptions['md5hash'] = $md5hash;
82   -
83   - if (!$oStorage->upload($oDocument, $sFilename, $aOptions)) {
  75 + if ( !$oStorage->upload( $oDocument, $sFilename)) {
84 76 return PEAR::raiseError(_kt('An error occurred while storing the new file'));
85 77 }
86 78  
... ...