[Fusionforge-commits] r13473 - branches/Branch_5_1/src/common/docman

Alain Peyrat aljeux at fusionforge.org
Fri Jun 10 12:05:45 CEST 2011


Author: aljeux
Date: 2011-06-10 12:05:45 +0200 (Fri, 10 Jun 2011)
New Revision: 13473

Modified:
   branches/Branch_5_1/src/common/docman/Document.class.php
Log:
Fix docman edit not working when using file.

Modified: branches/Branch_5_1/src/common/docman/Document.class.php
===================================================================
--- branches/Branch_5_1/src/common/docman/Document.class.php	2011-06-10 09:55:25 UTC (rev 13472)
+++ branches/Branch_5_1/src/common/docman/Document.class.php	2011-06-10 10:05:45 UTC (rev 13473)
@@ -197,6 +197,7 @@
 		}
 
 		if (!$this->fetchData($docid)) {
+			$this->setError(_('Error fetching Document'));
 			db_rollback();
 			return false;
 		}
@@ -679,8 +680,8 @@
 		}
 
 		if ($filename) {
-			$result = db_query_params('SELECT filename, doc_group FROM docdata_vw WHERE filename = $1 and doc_group = $2 and stateid = $3',
-						array($filename, $doc_group, $stateid));
+			$result = db_query_params('SELECT filename, doc_group FROM docdata_vw WHERE filename = $1 AND doc_group = $2 AND stateid = $3 AND docid != $4',
+						array($filename, $doc_group, $stateid, $this->getID()));
 			if (!$result || db_numrows($result) > 0) {
 				$this->setError(_('Document already published in this directory'));
 				return false;




More information about the Fusionforge-commits mailing list