Commit e7f0bcaeb9c824f30ddcb27cb0fa42a004e1afda
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
Showing
2 changed files
with
1 additions
and
15 deletions
lib/documentmanagement/documentcontentversion.inc.php
| @@ -61,8 +61,6 @@ class KTDocumentContentVersion extends KTEntity { | @@ -61,8 +61,6 @@ class KTDocumentContentVersion extends KTEntity { | ||
| 61 | /** Where in the storage this file can be found */ | 61 | /** Where in the storage this file can be found */ |
| 62 | var $sStoragePath; | 62 | var $sStoragePath; |
| 63 | 63 | ||
| 64 | - var $md5hash; | ||
| 65 | - | ||
| 66 | var $_aFieldToSelect = array( | 64 | var $_aFieldToSelect = array( |
| 67 | "iId" => "id", | 65 | "iId" => "id", |
| 68 | 66 | ||
| @@ -74,7 +72,6 @@ class KTDocumentContentVersion extends KTEntity { | @@ -74,7 +72,6 @@ class KTDocumentContentVersion extends KTEntity { | ||
| 74 | "iMajorVersion" => 'major_version', | 72 | "iMajorVersion" => 'major_version', |
| 75 | "iMinorVersion" => 'minor_version', | 73 | "iMinorVersion" => 'minor_version', |
| 76 | "sStoragePath" => 'storage_path', | 74 | "sStoragePath" => 'storage_path', |
| 77 | - 'md5hash' => 'md5hash' | ||
| 78 | ); | 75 | ); |
| 79 | 76 | ||
| 80 | function KTDocumentContentVersion() { | 77 | function KTDocumentContentVersion() { |
| @@ -82,7 +79,6 @@ class KTDocumentContentVersion extends KTEntity { | @@ -82,7 +79,6 @@ class KTDocumentContentVersion extends KTEntity { | ||
| 82 | 79 | ||
| 83 | function getFileName() { return $this->sFileName; } | 80 | function getFileName() { return $this->sFileName; } |
| 84 | function setFileName($sNewValue) { $this->sFileName = $sNewValue; } | 81 | function setFileName($sNewValue) { $this->sFileName = $sNewValue; } |
| 85 | - function getDocumentId() { return $this->iDocumentId; } | ||
| 86 | function getFileSize() { return $this->iSize; } | 82 | function getFileSize() { return $this->iSize; } |
| 87 | function setFileSize($iNewValue) { $this->iSize = $iNewValue; } | 83 | function setFileSize($iNewValue) { $this->iSize = $iNewValue; } |
| 88 | function getSize() { return $this->iSize; } | 84 | function getSize() { return $this->iSize; } |
| @@ -95,8 +91,6 @@ class KTDocumentContentVersion extends KTEntity { | @@ -95,8 +91,6 @@ class KTDocumentContentVersion extends KTEntity { | ||
| 95 | function setMinorVersionNumber($iNewValue) { $this->iMinorVersion = $iNewValue; } | 91 | function setMinorVersionNumber($iNewValue) { $this->iMinorVersion = $iNewValue; } |
| 96 | function getStoragePath() { return $this->sStoragePath; } | 92 | function getStoragePath() { return $this->sStoragePath; } |
| 97 | function setStoragePath($sNewValue) { $this->sStoragePath = $sNewValue; } | 93 | function setStoragePath($sNewValue) { $this->sStoragePath = $sNewValue; } |
| 98 | - function getStorageHash() { return $this->md5hash; } | ||
| 99 | - function setStorageHash($sNewValue) { $this->md5hash = $sNewValue; } | ||
| 100 | 94 | ||
| 101 | function getVersion() { | 95 | function getVersion() { |
| 102 | return sprintf("%s.%s", $this->getMajorVersionNumber(), $this->getMinorVersionNumber()); | 96 | return sprintf("%s.%s", $this->getMajorVersionNumber(), $this->getMinorVersionNumber()); |
lib/documentmanagement/documentutil.inc.php
| @@ -71,16 +71,8 @@ class KTDocumentUtil { | @@ -71,16 +71,8 @@ class KTDocumentUtil { | ||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | KTDocumentUtil::copyMetadata($oDocument, $iPreviousMetadataVersion); | 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 | return PEAR::raiseError(_kt('An error occurred while storing the new file')); | 76 | return PEAR::raiseError(_kt('An error occurred while storing the new file')); |
| 85 | } | 77 | } |
| 86 | 78 |