The latest 7.x-3.14 update has seen a modification of the View styles plugin - views_plugin_style.inc - that forces row style CSS class names to lowercase.
See line 142 of latest release -
$class = drupal_html_class($class);
Previous release -
$class = drupal_clean_css_identifier($class);
While Drupal CSS coding standards require lowercase css class names, this field is a user input field and should NOT be forced to lowercase. It is unexpected behaviour.
As per the HTML 4 standard certain HTML attributes, such as ID and Class are CASE SENSITIVE.
https://www.w3.org/TR/html4/struct/global.html#h-7.5.2
This change has and WILL break things.
I suggest that this change is rolled back ASAP.
Comment | File | Size | Author |
---|---|---|---|
#14 | views-row-CSS-class-name-is-forced-to-lowercase-2750021-14.patch | 1.66 KB | bsains |
| |||
#9 | views-row-CSS-class-name-is-forced-to-lowercase-2750021-11300163.patch | 511 bytes | bsains |
Comments
Comment #2
bsains CreditAttribution: bsains commentedRelated issue and applied updates-
https://www.drupal.org/node/1262630#comment-10675180
Comment #3
banoodle CreditAttribution: banoodle at Molly Duggan Associates commentedUpgrading to Views 7.x-3.14 is definitely rendering my mixed case Row classes as lower case.
I know what you're thinking: just change my styles, right? Well, unfortunately, that's not an option because I am working with a 3rd party API (RoyalSlider) and for it to work, I have to be able to add a Row class of rsContent.
I guess I'll just move this class to a template instead for now.
Anne
Comment #4
bondjimbond CreditAttribution: bondjimbond commentedIt seems to have broken things on my site - very much messed up the mobile version of my Views-powered responsive theme.
Comment #5
banoodle CreditAttribution: banoodle at Molly Duggan Associates commentedI thought I could just move my mixed-case div class to my theme's views row template (i.e., views-view-fields.tpl.php), but in my case that left an extra classless div wrapped around each row which makes RoyalSlider scripts not work as intended. The solution was to also override the unformatted view template as suggested here: http://drupal.stackexchange.com/questions/29677/how-can-i-remove-the-def...
Comment #6
bsains CreditAttribution: bsains commented@banoodle
Yes... there is a probably a number of work-a-rounds for this, but I wouldn't call it a solution.
The solution is to move back to the drupal_clean_css_identifier function rather than using drupal_html_class.
As you can see, drupal_html_class is converting the passed string to lowercase and then processing the string through drupal_clean_css_identifier function.
I have no idea why you would mess with a user defined string in such a way without at least providing some validation in the UI.
Comment #7
bsains CreditAttribution: bsains commentedComment #9
bsains CreditAttribution: bsains commentedComment #10
bsains CreditAttribution: bsains commentedComment #11
bsains CreditAttribution: bsains commentedComment #14
bsains CreditAttribution: bsains commentedReroll patch to include update to test that was failing due to the inclusion of drupal_html_class. Also includes update for spelling error.
Comment #15
bsains CreditAttribution: bsains commentedComment #16
abarpetia CreditAttribution: abarpetia as a volunteer commentedNo offence but It's really frustrating to suddenly force user input field to lowercase.
+1 for :bsains patch. Tested on my dev website.
Thanks
Comment #17
KimNyholm CreditAttribution: KimNyholm as a volunteer commentedLowercasing mix/upper case class names breaks legacy CSS styling and JQuery functionality.
+1 for committing bsains patch. Tested on my dev site with Drupal 7.44.
Comment #18
DamienMcKennaThis looks good.
Comment #19
kevster CreditAttribution: kevster commentedI can confirm this messed up my site on some views with case sensitive styles and the patch fixed it for me thx..
Comment #20
John Pitcairn CreditAttribution: John Pitcairn commentedRelated: #2765107: Regression: spaces in multivalue row class token separators are replaced with dashes, preventing multiple classes (patch)
Comment #21
John Pitcairn CreditAttribution: John Pitcairn commentedComment #22
GiorgosK#14 patch works as it should please commit
Comment #23
jrattanpal CreditAttribution: jrattanpal commentedWhen will 3.15 be released? 3.14 is marked as security update but it breaks the site because it converts styles to lower case.
Comment #24
scottrigby#14 FTW. This was a regression introduced in #1262630-49: Raw value tokens not replaced if used in css class, and just needs this piece reverted.
Note there is an older issue to make this a config, which could be resuscitated if anyone cares to force lowercase: #1571352: Lower case row classes.
Comment #25
michael@flesinzee.be CreditAttribution: michael@flesinzee.be commentedAny news on 3.15 release?
TIA.
Comment #26
DamienMcKennaBumping to the next release.
Comment #28
DamienMcKennaCommitted, so it'll be in 3.16. Sorry for the year of it being broken.
That said, this needs a change record.
Comment #29
DamienMcKennaI've created a change notice for this: https://www.drupal.org/node/2859911
Comment #30
DamienMcKenna