Commit 47e0b84a98ebebe6e0a855c74628ca9cea3229ff
1 parent
92225d19
KTS-4115. This change is only indirectly related to this issue. The canBeMoved …
…function was modified in the original fix to contain an argument by reference for returning a PEAR error object for more user friendly error reporting. The call to canBeMoved in ktapi/KTAPIDocument.inc.php did not include this additional argument. It has now been added along with the check for returning the more detailed error should there be one, or the original more generic error in absence of a detailed error. Immutable documents can still be moved Fixed Committed by: Paul Barrett Reviewed by Megan Watson
Showing
1 changed file
with
9 additions
and
2 deletions
ktapi/KTAPIDocument.inc.php
| ... | ... | @@ -785,9 +785,16 @@ class KTAPI_Document extends KTAPI_FolderItem |
| 785 | 785 | return $result; |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | - if (!KTDocumentUtil::canBeMoved($this->document)) | |
| 788 | + if (!KTDocumentUtil::canBeMoved($this->document, $error)) | |
| 789 | 789 | { |
| 790 | - return new PEAR_Error('Document cannot be moved.'); | |
| 790 | + if (PEAR::isError($error)) | |
| 791 | + { | |
| 792 | + return $error; | |
| 793 | + } | |
| 794 | + else | |
| 795 | + { | |
| 796 | + return new PEAR_Error('Document cannot be moved.'); | |
| 797 | + } | |
| 791 | 798 | } |
| 792 | 799 | |
| 793 | 800 | $name = $this->document->getName(); | ... | ... |