Opened 5 years ago

Closed 5 years ago

#31441 closed Bug (fixed)

TabluarInline will not auto unhide/expand when classes = ['collapse'] and there is error during the saving process in django admin

Reported by: Jian Owned by: Hasan Ramezani
Component: contrib.admin Version: 3.0
Severity: Normal Keywords: admin.TabularInline
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

For the admin.StackedInline and classes = collapse, it will auto add the red color border to the error field and the admin page will auto unhide/expand for the inline.

For the admin.TabularInline and classes = collapse, it will not add the red color border and the auto unhide/expand is not working.

Attachments (3)

StackedInline.png (51.0 KB ) - added by Jian 5 years ago.
TabularInline1.png (36.2 KB ) - added by Jian 5 years ago.
TabularInline2.png (41.0 KB ) - added by Jian 5 years ago.

Download all attachments as: .zip

Change History (13)

by Jian, 5 years ago

Attachment: StackedInline.png added

by Jian, 5 years ago

Attachment: TabularInline1.png added

by Jian, 5 years ago

Attachment: TabularInline2.png added

comment:1 by Carlton Gibson, 5 years ago

Triage Stage: UnreviewedAccepted

Hi Jian. This looks valid. Thanks for the report. Do you fancy trying to resolve it?

comment:2 by Hasan Ramezani, 5 years ago

Owner: changed from nobody to Hasan Ramezani
Status: newassigned

comment:3 by Hasan Ramezani, 5 years ago

I checked it. There are 3 problems when there is an error during the save:

  • admin.TabularInline will not show a red border
  • admin.TabularInline will not expand
  • admin.TabularInline and admin.StackedInline will not show Hide link when there is an error and formset is expanded

I am going to prepare a patch to address the first 2 problems. not sure the third one is a problem or not.

Last edited 5 years ago by Hasan Ramezani (previous) (diff)

comment:4 by Hasan Ramezani, 5 years ago

Has patch: set

I created a PR to address the first two options.

comment:5 by Carlton Gibson, 5 years ago

Patch needs improvement: set

comment:6 by Hasan Ramezani, 5 years ago

Patch needs improvement: unset

comment:7 by Carlton Gibson, 5 years ago

Triage Stage: AcceptedReady for checkin

comment:8 by Carlton Gibson, 5 years ago

admin.TabularInline and admin.StackedInline will not show Hide link when there is an error and formset is expanded

I'm inclined to think we can leave that. That it's a feature: if there's an error don't let you collapse the inline, so you can't forget about it.
(No doubt X years from now, such ticket is opened... :)

I'm not 100% against but there's probably a better use of time.

comment:9 by Carlton Gibson <carlton@…>, 5 years ago

In b4e7bf52:

Refs #31441 -- Added red border to inputs with errors for TabluarInline.

comment:10 by Carlton Gibson <carlton@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 96c6f9c6:

Fixed #31441 -- Ensured TabluarInline expands when child inputs have errors.

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