I cannot find a related issue reporting this bug so I create a new issue.
This bug can be reproduced by
- creating a multiple value field to page content type
- creating a new page node and adding values to that field
So when you save this page and you can see the class of first field item has even and second one has class odd.
Here is the code in the field.tpl.php
<div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
Note that the $delta of field always starts from 0, which makes the first item has 'even' class.
Just need to swap two class names to fix the bug.
I have checked Drupal 8 and there is no odd and even class used in field.html.twig anymore. So I assume only to fix Drupal 7.
Comments
Comment #2
eric.chenchao commentedComment #3
eric.chenchao commentedComment #6
eric.chenchao commentedWhy have this queued test not been runing for 2 months?
Comment #8
tandroid commentedThis seems like a bigger issue than we're letting on primarily because it's been in core for so long that switching it now would cause major theming issues on thousands of sites. It would essentially require anyone who hasn't overridden field.tpl.php in their own theme to change all of the theming they've done using these classes. As disappointing as it is to say, I do not think this should be fixed.
Comment #9
vikashsoni commented@eric.chenchao patch apply successfully for me
Thanks