Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is unnecessary duplication of CSS classes added to field items when there is no label and there are multiple items. See screenshots.
This is a bug, and not just philosophical, because if you use any proportional declarations, like setting width in percentage, it gets applied twice. Also, given or CSS naming standards, most of these classes shouldn't be repeated within the same hierarchical path.
Before
After
Comment | File | Size | Author |
---|---|---|---|
#4 | Screen Shot 2015-08-31 at 6.07.24 PM.png | 29.27 KB | RainbowArray |
extraclassesonfields.patch | 615 bytes | davidhernandez | |
after-fieldclasswithnolabel.png | 146.4 KB | davidhernandez | |
before-fieldclasswithnolabel.png | 211.09 KB | davidhernandez |
Comments
Comment #2
davidhernandezComment #3
davidhernandezForgot to set status so the patch gets tested.
Comment #4
RainbowArrayThis looks really good to me. I tried to look back at #2214241: Field default markup - removing the divitis to see where this was introduced, but it looks like it was pretty far back. This makes much more sense. We shouldn't be using the classes variable on both attributes and item.attributes, which is what was happening.
Very good catch.
Tested this and verified it fixes the problem.
Comment #5
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 54b6085 and pushed to 8.0.x. Thanks!