Closed Bug 653404 Opened 13 years ago Closed 13 years ago

Misleading error message when file to be attached is not readable by browser

Categories

(Bugzilla :: Attachments & Requests, defect)

3.6.3
defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: sascha.schwedes, Assigned: LpSolit)

References

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Build Identifier: 3.6.3

When you try to attach a file for that your browser doesn't have read permissions, you get misleading error messages that even depend on the content-type you've selected.

Reproducible: Always

Steps to Reproduce:
1. Create an attachment using a file your browser doesn't have read permissions
2. Add a description
3. Click on "Submit"

Actual Results:  
The exact error message depends on the content type choosing mechanism. If you select to autodetect the mime type, bugzilla says you didn't specify a file. If you choose "text/plan", you get the following message:

The function Bugzilla::Attachment->create requires a description argument, and that argument was not set.

Expected Results:  
An error message saying "don't have the permission to attach this file" for all content-type settings.

See also Bug 389844
See Also: → 389844
Version: unspecified → 3.6.3
Ah, this would explain why some users had this error in the past. Thanks for the bug! :) Bug 389844 is unrelated. It's just about improving the error message. Here, the root cause is different.
Severity: enhancement → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86_64 → All
See Also: 389844
Target Milestone: --- → Bugzilla 4.0
We first have to store the filehandle in a variable before passing it to create().
Assignee: attach-and-request → LpSolit
Status: NEW → ASSIGNED
Attachment #528830 - Flags: review+
Same patch as for trunk, but the patch for 4.2 doesn't apply cleanly due to an unrelated change in the neighbourhood.
Attachment #528832 - Flags: review?(glob)
Attachment #528830 - Attachment description: patch for 4.2 → patch for 4.2, v1
Comment on attachment 528832 [details] [diff] [review]
patch for 4.0, v1

Review of attachment 528832 [details] [diff] [review]:

r=glob
Attachment #528832 - Flags: review?(glob) → review+
Flags: approval4.0+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified attachment.cgi
Committed revision 7804.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified attachment.cgi
Committed revision 7589.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: