Commit 380fb732d73558feb040f4b3d9a2c107292b20c7

Authored by kevin_fourie
1 parent a5503889

KTS-1671

"Validation breaks: Unable to move file into folder after copied file has been deleted."
Fixed.

Reviewed By: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@6302 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/documentmanagement/Document.inc
@@ -296,7 +296,7 @@ class Document { @@ -296,7 +296,7 @@ class Document {
296 $sQuery = "SELECT D.id AS id FROM $sD AS D 296 $sQuery = "SELECT D.id AS id FROM $sD AS D
297 LEFT JOIN $sDM AS DM ON D.metadata_version_id = DM.id 297 LEFT JOIN $sDM AS DM ON D.metadata_version_id = DM.id
298 LEFT JOIN $sDC AS DC ON DM.content_version_id = DC.id 298 LEFT JOIN $sDC AS DC ON DM.content_version_id = DC.id
299 - WHERE DC.filename = ? AND D.folder_id = ?"; 299 + WHERE DC.filename = ? AND D.folder_id = ? AND D.status_id=1";
300 $aParams = array($sFileName, $iFolderID); 300 $aParams = array($sFileName, $iFolderID);
301 $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); 301 $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id');
302 if (empty($id)) { 302 if (empty($id)) {
@@ -336,7 +336,7 @@ class Document { @@ -336,7 +336,7 @@ class Document {
336 $sQuery = "SELECT D.id AS id FROM $sD AS D 336 $sQuery = "SELECT D.id AS id FROM $sD AS D
337 LEFT JOIN $sDM AS DM ON D.metadata_version_id = DM.id 337 LEFT JOIN $sDM AS DM ON D.metadata_version_id = DM.id
338 LEFT JOIN $sDC AS DC ON DM.content_version_id = DC.id 338 LEFT JOIN $sDC AS DC ON DM.content_version_id = DC.id
339 - WHERE DM.name = ? AND D.folder_id = ?"; 339 + WHERE DM.name = ? AND D.folder_id = ? AND D.status_id=1";
340 $aParams = array($sName, $iFolderID); 340 $aParams = array($sName, $iFolderID);
341 $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id'); 341 $id = DBUtil::getOneResultKey(array($sQuery, $aParams), 'id');
342 if (empty($id)) { 342 if (empty($id)) {