Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0037370mantisbtattachmentspublic2026-09-06 18:08
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2.29.0 
Target Version2.29.0 
Summary0037370: 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, false is simply passed on to the Command's issue_id query parameter, and validate() returns a misleading error message: "'issue_id' missing". While this is technically true, it does not help the user figure out what is wrong with their request.

A more meaningful error message should be returned.
l

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().

TagsNo tags attached.

Relationships

related to 0034425 resolvedvboctor Delete attachment via REST 

Activities