Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#12466 closed (fixed)

required class are also added to not required fields

Reported by: Bernd Schlapsi <brot@…> Owned by: Jannis Leidel
Component: Forms Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Since [11830] there is the option to add css classes for errors and for required fields. But there is a error in the implementation. If you have a model with a few fields and there is a required field before a non required field the non required fields will also be given an "required" class.
This is a bug because the initialization of the variable which stores the classes is only initialize once before the for loop.

Attachments (3)

patch_css_classes.diff (749 bytes ) - added by Bernd Schlapsi <brot@…> 14 years ago.
patch for this issue
patch_css_classes.2.diff (2.2 KB ) - added by Bernd Schlapsi <brot@…> 14 years ago.
patch, now with a test
patch_css_classes.3.diff (2.7 KB ) - added by Bernd Schlapsi <brot@…> 14 years ago.
patch with extended test

Download all attachments as: .zip

Change History (8)

by Bernd Schlapsi <brot@…>, 14 years ago

Attachment: patch_css_classes.diff added

patch for this issue

comment:1 by Alex Gaynor, 14 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

The patch looks correct to me, can you write up a simple test for this?

by Bernd Schlapsi <brot@…>, 14 years ago

Attachment: patch_css_classes.2.diff added

patch, now with a test

comment:2 by Bernd Schlapsi <brot@…>, 14 years ago

Needs tests: unset

by Bernd Schlapsi <brot@…>, 14 years ago

Attachment: patch_css_classes.3.diff added

patch with extended test

comment:3 by Jannis Leidel, 14 years ago

Owner: changed from nobody to Jannis Leidel
Status: newassigned

comment:4 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [12153]) Fixed #12466 - Set HTML class attributes for each field separately. Thanks for the patch, Bernd Schlapsi.

comment:5 by Jacob, 12 years ago

milestone: 1.2

Milestone 1.2 deleted

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