required class are also added to not required fields
|Reported by:||Owned by:||Jannis Leidel|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Since  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.