Opened 5 years ago

Closed 4 years ago

Last modified 4 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 5 years ago.
13510_tabular_inline_errors_colspan.diff (5.0 KB) - added by julien 4 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by KyleMac

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 4 years ago by julien

comment:2 Changed 4 years ago by julien

  • Has patch set
  • milestone set to 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 4 years ago by ramiro

  • Resolution set to fixed
  • Status changed from new to closed

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 4 years ago by ramiro

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 4 years ago by ramiro

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 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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