Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#13510 closed (fixed)

Row level errors on ModelForms in the admin mess up colspans

Reported by: KyleMac Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Row level errors on ModelForms in the admin have their colspan set based on the number of fields on the model rather than what are actually being displayed in the admin, i.e. it doesn't take into account editable=False (and maybe excludes too). This can lead to the some display issues.

Also when row level errors are displayed the colspan on the "add another" row reverts to 1.

A screenshot shows it best.

Attachments (2)

django admin.png (64.8 KB) - added by KyleMac 7 years ago.
13510_tabular_inline_errors_colspan.diff (5.0 KB) - added by Julien Phalip 6 years ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by KyleMac

Attachment: django admin.png added

comment:1 Changed 7 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

Changed 6 years ago by Julien Phalip

comment:2 Changed 6 years ago by Julien Phalip

Has patch: set
milestone: 1.3

In fact here the colspan should be 4, not 3 (there's an invisible cell containing a hidden field). The attached patch should fix this problem.

comment:3 Changed 6 years ago by Ramiro Morales

Resolution: fixed
Status: newclosed

In [15626]:

Fixed #13510 -- Corrected colspan of non-field-specific error messages in admin app tabular inlines so it isn't greater than the actual number of field cells. Thanks KyleMac for the report and Julien Phalip for the patch fixing the issue.

comment:4 Changed 6 years ago by Ramiro Morales

In [15627]:

[1.2.X] Fixed #13510 -- Corrected colspan of non-field-specific error messages in admin app tabular inlines so it isn't greater than the actual number of field cells. Thanks KyleMac for the report and Julien Phalip for the patch fixing the issue.

Backport of [15626] from trunk.

comment:5 Changed 6 years ago by Ramiro Morales

I couldn't reproduce the Colspan on the "Add another" button row reverting to 1 issue. If you still see it, please open another ticket with more detailed instructions on how to reproduce it.

comment:6 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top