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.

Comments

bsains created an issue. See original summary.

bsains’s picture

Related issue and applied updates-

https://www.drupal.org/node/1262630#comment-10675180

banoodle’s picture

Upgrading 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

bondjimbond’s picture

It seems to have broken things on my site - very much messed up the mobile version of my Views-powered responsive theme.

banoodle’s picture

I 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...

bsains’s picture

@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.

bsains’s picture

Version: 7.x-3.14 » 7.x-3.x-dev
Assigned: Unassigned » bsains
Status: Active » Needs review
StatusFileSize
new893 bytes

Status: Needs review » Needs work
bsains’s picture

bsains’s picture

bsains’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

bsains’s picture

Status: Needs work » Needs review
StatusFileSize
new1.66 KB

Reroll patch to include update to test that was failing due to the inclusion of drupal_html_class. Also includes update for spelling error.

bsains’s picture

Priority: Critical » Major
abarpetia’s picture

No offence but It's really frustrating to suddenly force user input field to lowercase.

+1 for :bsains patch. Tested on my dev website.

Thanks

KimNyholm’s picture

Lowercasing 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.

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community
Parent issue: » #2505379: Plan for Views 7.x-3.15 release

This looks good.

kevster’s picture

I can confirm this messed up my site on some views with case sensitive styles and the patch fixed it for me thx..

giorgosk’s picture

#14 patch works as it should please commit

jrattanpal’s picture

When will 3.15 be released? 3.14 is marked as security update but it breaks the site because it converts styles to lower case.

scottrigby’s picture

#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.

michael@flesinzee.be’s picture

Any news on 3.15 release?
TIA.

damienmckenna’s picture

  • DamienMcKenna committed 8d944c6 on 7.x-3.x authored by bsains
    Issue #2750021 by bsains: View Styles Plugin - row CSS class name was...
damienmckenna’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

Committed, so it'll be in 3.16. Sorry for the year of it being broken.

That said, this needs a change record.

damienmckenna’s picture

Status: Needs work » Fixed
Issue tags: -Needs change record

I've created a change notice for this: https://www.drupal.org/node/2859911

damienmckenna’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.