Opened 14 years ago
Last modified 13 years ago
#14858 closed
Bug in admin change_form template produces javascript error when adding new object with first_field of type DateTimeField. — at Version 1
Reported by: | mkelley33 | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.2 |
Severity: | Keywords: | admin templates javascript error | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Scenario:
- User fires up admin site in browser (bug is not browser specific), and goes to admin/app_name/model_name/
- User clicks the add button in upper-right-hand corner.
- The change_form.html template is rendered, and ready to add a new object.
- Then the user's browser complains and throws an error, because the user (for whatever--probably strange and arguably wrong--reason) made created_datetime of type DateTimeField be the first_field.
Error or Bug:
Error: document.getElementById("id_created_date") is null Source File: http://127.0.0.1:8000/admin/app_name/model_name/add/
Cause:
The DateTimeField outputs two fields:
- created_date_0
- created_date_1
Solution:
See attached patch file.
Change History (2)
by , 14 years ago
Attachment: | change_form_r14851_js_bug_fix.diff added |
---|
comment:1 by , 14 years ago
Description: | modified (diff) |
---|
This had already been reported as #14364. Will try to reproduce with the more detailed instructions above before deciding final triage status.
Note:
See TracTickets
for help on using tickets.
Patch for JavaScript bug in change_form.html on admin site.