Commit 8df754fed3593c3eee098edef95aef05921ae20f

Authored by Neil Blakey-Milner
1 parent 46098f3e

Fix deletion on expunge for the hashed layout.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5477 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/storage/ondiskhashedstoragemanager.inc.php
@@ -260,17 +260,12 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { @@ -260,17 +260,12 @@ class KTOnDiskHashedStorageManager extends KTStorageManager {
260 $oConfig =& KTConfig::getSingleton(); 260 $oConfig =& KTConfig::getSingleton();
261 $sCurrentPath = $this->getPath($oDocument); 261 $sCurrentPath = $this->getPath($oDocument);
262 262
263 - // check if the deleted folder exists and create it if not  
264 - $sDeletedPrefix = sprintf("%s/Deleted", $oConfig->get('urls/documentRoot'));  
265 $sDocumentRoot = $oConfig->get('urls/documentRoot'); 263 $sDocumentRoot = $oConfig->get('urls/documentRoot');
266 264
267 $aVersions = KTDocumentContentVersion::getByDocument($oDocument); 265 $aVersions = KTDocumentContentVersion::getByDocument($oDocument);
268 foreach ($aVersions as $oVersion) { 266 foreach ($aVersions as $oVersion) {
269 - $sPath = sprintf("Deleted/%s-%s", $oVersion->getId(), $oVersion->getFileName());  
270 - $sFullPath = sprintf("%s/%s", $sDocumentRoot, $sPath);  
271 - if (file_exists($sFullPath)) {  
272 - unlink($sFullPath);  
273 - } 267 + $sPath = sprintf('%s/%s', $sDocumentRoot, $oVersion->getStoragePath());
  268 + @unlink($sPath);
274 } 269 }
275 return true; 270 return true;
276 } 271 }