View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012540 | mantisbt | api soap | public | 2010-11-18 09:13 | 2010-12-17 04:37 |
Reporter | sveyret | Assigned To | rombert | ||
Priority | low | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | i686 | OS | Linux | OS Version | 2.6.9 |
Product Version | 1.2.3 | ||||
Target Version | 1.2.4 | Fixed in Version | 1.2.4 | ||
Summary | 0012540: mc_issue_attachment_get does not use the path for the file | ||||
Description | When trying to download an issue, I have a server error: Unable to find an attachment with type bug and id xxxxx. | ||||
Steps To Reproduce | Create a web service and use mc_issue_attachment_get to get the attachment of an issue. | ||||
Additional Information | I will create and attach a patch asap. | ||||
Tags | patch | ||||
Attached Files | soap_download.patch (619 bytes)
diff -Naur mantisbt-1.2.3/api/soap/mc_file_api.php mantisbt-patch/api/soap/mc_file_api.php --- mantisbt-1.2.3/api/soap/mc_file_api.php 2010-11-18 15:53:59.000000000 +0100 +++ mantisbt-patch/api/soap/mc_file_api.php 2010-11-18 15:56:40.000000000 +0100 @@ -175,9 +175,10 @@ $t_project_id = $row['project_id']; } else if ( $p_type == 'bug' ) { $t_bug_id = $row['bug_id']; + $t_project_id = bug_get_field( $t_bug_id, 'project_id' ); } - $t_diskfile = $row['diskfile']; + $t_diskfile = file_normalize_attachment_path( $row['diskfile'], $t_project_id ); $t_content = $row['content']; # Check access rights | ||||
Actually, it seems a little bit more complicated. It looks like Mantis used to store the full file name (including path) in the diskfile field, which is not the case anymore. |
|
Looks like something which I've also seen. Looking forward to your patch. |
|
Here it is, to be installed with “patch -p1” at the root of the Mantis installation directory (not a git patch, I really need to install git at my work!) Hope it will help! |
|
Thanks for the patch. I've applied it with your author credentials. I suggest you look into git nevertheless :-) |
|