Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#7576 closed (duplicate)

Fieldsets marked as collapsed should not be collapsed on errors

Reported by: Jonas von Poser Owned by: nobody
Component: Contrib apps Version: newforms-admin
Severity: Keywords: nfa
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Current behaviour:

Using newforms-admin, I edit a model field that's contained in a collapsible fieldset. If this field does not validate, for instance I input a character string in an IntegerField, the page gets redisplayed after submitting and an error gets shown next to the field. On the redisplayed edit page, the fieldset containing the error is collapsed again.

Expected behaviour:

When a fieldset contains an error, it should not be collapsed so the error can be found easily. In fact, the comments in django/contrib/admin/media/js/admin/CollapsedFieldsets.js:22 say so: "Collapsing shouldn't apply in the case of error messages."

Fix:

The bug is in djang/contrib/admin/media/js/CollapsedFieldsets.js in the function named "fieldset_has_errors". A loop checks for the CSS class "error", but the DIV displaying the error is currently marked with a class called "errors".

I've attached a patch that fixes this. Thank you for considering it.

Attachments (1)

fieldset_has_errors.patch (632 bytes ) - added by Jonas von Poser 16 years ago.
Patch to fix display of collapsed fieldset on errors

Download all attachments as: .zip

Change History (3)

by Jonas von Poser, 16 years ago

Attachment: fieldset_has_errors.patch added

Patch to fix display of collapsed fieldset on errors

comment:1 by Brian Rosner, 16 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #5873. Will apply this patch shortly. Excellent work Jonas!

comment:2 by Jacob, 13 years ago

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

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