Code

Opened 2 years ago

Closed 2 years ago

#18477 closed Bug (fixed)

TabularInline admin uses wrong colspan in Add row

Reported by: yedpodtrzitko Owned by: nobody
Component: contrib.admin Version: 1.4
Severity: Normal Keywords: javascript, admin
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

Problem:
TabularInline admin generates 'Add another' row via javascript, calculating value of colspan attribute from count of children in first Formset's row. If Formset validation fails, there appears an error message as a first row, which has always only one column. As a result 'Add another' row uses bad value in colspan (1).

Patch uses last row (instead of first one) for calculating colspan attribute.

Attachments (2)

patch_inlines.js (3.8 KB) - added by yedpodtrzitko 2 years ago.
calculate proper colspan for A
inlines_patch.diff (3.8 KB) - added by yedpodtrzitko 2 years ago.
calculate proper colspan for 'Add another' row (once again, proper filename ext.)

Download all attachments as: .zip

Change History (4)

Changed 2 years ago by yedpodtrzitko

calculate proper colspan for A

Changed 2 years ago by yedpodtrzitko

calculate proper colspan for 'Add another' row (once again, proper filename ext.)

comment:1 Changed 2 years ago by yedpodtrzitko

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Type changed from Uncategorized to Bug

comment:2 Changed 2 years ago by Julien Phalip <jphalip@…>

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

In [1ace912f7e1916e03bc91ef91318803817d6a72e]:

Fixed #18477 -- Fixed colspan value when a TabularInline form contains validation errors. Thanks to yedpodtrzitko for the report and patch.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.