Commit 7d85e46b251a09109791dad7f8871b91a756bd5d

Authored by conradverm
1 parent dca9557f

WSA-102

"Mechanics of adding a document to repository is not the same from 3.4.4 to 3.4.5+. This means that the web service base code results in empty documents being added in 3.4.4 if the newer ktapi code is backported."
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Jonathan Byrne


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7946 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 2 additions and 2 deletions
ktapi/KTAPIFolder.inc.php
@@ -610,7 +610,7 @@ class KTAPI_Folder extends KTAPI_FolderItem @@ -610,7 +610,7 @@ class KTAPI_Folder extends KTAPI_FolderItem
610 610
611 611
612 $options = array( 612 $options = array(
613 - //'contents' => new KTFSFileLike($tempfilename), 613 + 'contents' => new KTFSFileLike($tempfilename),
614 'temp_file' => $tempfilename, 614 'temp_file' => $tempfilename,
615 'novalidate' => true, 615 'novalidate' => true,
616 'documenttype' => DocumentType::get($documenttypeid), 616 'documenttype' => DocumentType::get($documenttypeid),
@@ -622,7 +622,7 @@ class KTAPI_Folder extends KTAPI_FolderItem @@ -622,7 +622,7 @@ class KTAPI_Folder extends KTAPI_FolderItem
622 DBUtil::startTransaction(); 622 DBUtil::startTransaction();
623 $document =& KTDocumentUtil::add($this->folder, $filename, $user, $options); 623 $document =& KTDocumentUtil::add($this->folder, $filename, $user, $options);
624 624
625 - if (!is_a($document,'Document')) 625 + if (PEAR::isError($document))
626 { 626 {
627 DBUtil::rollback(); 627 DBUtil::rollback();
628 return new PEAR_Error(KTAPI_ERROR_INTERNAL_ERROR . ' : ' . $document->getMessage()); 628 return new PEAR_Error(KTAPI_ERROR_INTERNAL_ERROR . ' : ' . $document->getMessage());