Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#12466 closed (fixed)

required class are also added to not required fields

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

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@…> 6 years ago.
patch for this issue
patch_css_classes.2.diff (2.2 KB) - added by Bernd Schlapsi <brot@…> 6 years ago.
patch, now with a test
patch_css_classes.3.diff (2.7 KB) - added by Bernd Schlapsi <brot@…> 6 years ago.
patch with extended test

Download all attachments as: .zip

Change History (8)

Changed 6 years ago by Bernd Schlapsi <brot@…>

patch for this issue

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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

Changed 6 years ago by Bernd Schlapsi <brot@…>

patch, now with a test

comment:2 Changed 6 years ago by Bernd Schlapsi <brot@…>

  • Needs tests unset

Changed 6 years ago by Bernd Schlapsi <brot@…>

patch with extended test

comment:3 Changed 6 years ago by jezdez

  • Owner changed from nobody to jezdez
  • Status changed from new to assigned

comment:4 Changed 6 years ago by jezdez

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

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

comment:5 Changed 4 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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