View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0037370 | mantisbt | attachments | public | 2026-09-05 13:23 | 2026-09-06 18:08 |
| Reporter | dregad | Assigned To | dregad | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | assigned | Resolution | open | ||
| Product Version | 2.29.0 | ||||
| Target Version | 2.29.0 | ||||
| Summary | 0037370: Misleading error message when trying to delete non-existing attachment via SOAP API | ||||
| Description | Unlike the REST API's `DELETE /issues/{id}/files/{file_id}' which includes the Issue Id, the SOAP API's mc_issue_attachment_delete endpoint only expects the attachment's id and does not allow specifying the issue id. The newly added IssueFileDeleteCommand (0034425) requires both issue_id and file_id; to accomodate this, mc_issue_attachment_delete calls file_get_field() to retrieve the issue id, but does check the return value to ensure that the file actually exists. The Web UI (bug_file_delete.php) does the same thing. So when the attachment does not exist, A more meaningful error message should be returned. | ||||
| Additional Information | Checking for the attachment's existence in the caller is one way to fix this, but it would introduce code duplication. It makes more sense to put this check in IssuefileDeleteCommand::validate(). | ||||
| Tags | No tags attached. | ||||