#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)
Change History (3)
by , 16 years ago
Attachment: | fieldset_has_errors.patch added |
---|
comment:1 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Duplicate of #5873. Will apply this patch shortly. Excellent work Jonas!
Patch to fix display of collapsed fieldset on errors