Bug.add_attachment is missing an error code and should fill in content_type for patches

RESOLVED FIXED in Bugzilla 4.0

Status

()

Bugzilla
Attachments & Requests
--
minor
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Max Kanat-Alexander, Assigned: Max Kanat-Alexander)

Tracking

Bugzilla 4.0
Bug Flags:
approval +
approval4.0 +
blocking4.0 +

Details

Attachments

(2 attachments)

(Assignee)

Description

8 years ago
Created attachment 511246 [details] [diff] [review]
v1, for 4.0

When writing the test in bug 629161 I discovered a few issues with Bug.add_attachment:

* It was missing an error code for attaching an empty "data" value.
* You should be able to set "is_patch => 1" without specifying a content type, and the content type should always be forced to "text/plain" for patches, but the backend wasn't doing this properly.
Flags: blocking4.0+
Attachment #511246 - Flags: review?(LpSolit)
(Assignee)

Updated

8 years ago
Assignee: attach-and-request → mkanat
Status: NEW → ASSIGNED

Comment 1

8 years ago
Comment on attachment 511246 [details] [diff] [review]
v1, for 4.0

Looks good, but only works for 4.0. is_url no longer exists in 4.1.
Attachment #511246 - Attachment description: v1 → v1, for 4.0
Attachment #511246 - Flags: review?(LpSolit) → review+
(Assignee)

Comment 2

8 years ago
Created attachment 511555 [details] [diff] [review]
v1, trunk

Okay, here's a similar patch for trunk.
Attachment #511555 - Flags: review?(LpSolit)

Comment 3

8 years ago
Comment on attachment 511555 [details] [diff] [review]
v1, trunk

>=== modified file 'Bugzilla/Attachment.pm'

>+use constant VALIDATOR_DEPENDENCIES => {
>+    mimetype => ['ispatch', 'isurl'],
>+};

isurl no longer exists on trunk. r=LpSolit with this one removed.
Attachment #511555 - Flags: review?(LpSolit) → review+

Updated

8 years ago
Flags: approval4.0+
Flags: approval+
(Assignee)

Comment 4

8 years ago
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/Attachment.pm
modified Bugzilla/WebService/Bug.pm
modified Bugzilla/WebService/Constants.pm
Committed revision 7696.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/
modified Bugzilla/Attachment.pm
modified Bugzilla/WebService/Bug.pm
modified Bugzilla/WebService/Constants.pm
Committed revision 7543.
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.