#11791 closed (fixed)
Incorrect HTML Code rendered in list_editable enabled changelists
Reported by: | Owned by: | Karen Tracey | |
---|---|---|---|
Component: | contrib.admin | Version: | 1.1 |
Severity: | Keywords: | list_editable, admin_list.py, items_for_result, opera | |
Cc: | romain_hardouin@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
items_for_result in django.contrib.admin.templatetags.admin_list.py appends the hidden field for the form-id to the output which, in the case of the multiple forms in the change form, results in an input field right after the last field which has been rendered:
Example:
<td><img src="http://127.0.0.1:8199/media/img/admin/icon-no.gif" alt="False" /></td><td><img src="http://127.0.0.1:8199/media/img/admin/icon-no.gif" alt="0" /></td><input type="hidden" name="form-1-id" value="3287" id="id_form-1-id" /></tr>
As far as I know that type of HTML element isn't allowed between the closing tags of TD and TR. This results in corrupted output when using Opera to view such a change list - it renders an empty blue line on top of the change list for every item in the change list.
A quick fix would be to let items_for_result "inject" the hidden input right after the last field itself, inside its TD, not outside.
Attachments (1)
Change History (9)
comment:1 by , 15 years ago
Cc: | added |
---|
comment:2 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 15 years ago
by , 15 years ago
Attachment: | result_list.diff added |
---|
Patch with tests for modified 'result_list' inclusion tag
comment:4 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:5 by , 15 years ago
Component: | Contrib apps → django.contrib.admin |
---|---|
Has patch: | set |
milestone: | → 1.2 |
Triage Stage: | Unreviewed → Accepted |
comment:6 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
It looks like line 245 in contrib/admin/templatetags/admin_list.py is missing the cell tags wrapper:
Changing this to
would fix the HTML validation but I'm not sure if it will introduce any issues with how the table will render. Working out some appropriate tests for this.