Closed Bug 1269146 Opened 9 years ago Closed 8 years ago

500 ISE when file is omitted from file attachment form

Categories

(developer.mozilla.org Graveyard :: File attachments, defect, P1)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwhitlock, Unassigned)

References

Details

(Keywords: in-triage, Whiteboard: [specification][type:bug])

What did you do? ================ 1. Edit a page 2. Select "UPLOAD FILES" 3. Fill out form but don't choose a file 4. Select "UPLOAD" What happened? ============== A 500 error What should have happened? ========================== A form validation error Is there anything else we should know? ====================================== Sentry entry: https://sentry.prod.mozaws.net/operations/mdn-prod/issues/328197/
When the file is not selected, 'file' is in cleaned_data, and this code fails with a KeyError: https://github.com/mozilla/kuma/blob/master/kuma/attachments/forms.py#L43
Priority: -- → P1
The steps only worked on browsers (such as Safari from 2 years ago) that ignore the "required" attribute of input elements. Other browsers don't allow you to submit the form without adding a file. One way around this is to modify the DOM with developer tools, remove the required attribute, and submit. Another way to reproduce is to create a zero-length file ("touch empty.txt" on MacOS / Linux) and upload that.
Fixed in PR mozilla/kuma#4475, associated with bug 1410559.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.