This is my first bug report, so forgive me if I'm doing this wrong.

After installing today's release of 7.x-3.6, some of the CSS on my page was no longer being applied. After some investigation, it appears that the CSS classes added in CSS properties are being converted to lower case. Upper case letters are still valid for class attributes and, since class attributes are case sensitive, it is preventing the CSS from being applied.

I suspect that this bug was introduced in the following feature request implemented in today's release:

https://www.drupal.org/node/1441218

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

karen11 created an issue. See original summary.

bkosborne’s picture

You are correct that the issue you linked introduced the problem. I realize now that the issue I created #2785917: Underscores in CSS IDs for panes are converted to hyphens after 3.6 update is similar to the one you reported here.

jackalope’s picture

Thanks for filing this issue @karen11, and thanks to @bkosborne for citing your related ticket! Since this one came first I'm going to mark #2785917: Underscores in CSS IDs for panes are converted to hyphens after 3.6 update as a duplicate so as to focus all efforts here.

jackalope’s picture

Actually @bkosborne, rather than closing your well-documented ticket myself, I'll suggest that you move your findings here if it's not too much trouble and close the other as a duplicate. :)

svenb’s picture

FileSize
820 bytes

What's the reason for lowercase CSS classes? In my opinion there's no need to do so. That's why I created a patch that just removes the drupal_strtolower($class) function.

bkosborne’s picture

Title: CSS properties are converted to lower case » CSS IDs for panes are potentially rewritten in 3.6 update, breaking themes that rely on them
bkosborne’s picture

Priority: Normal » Major

Marked my issue #2785917: Underscores in CSS IDs for panes are converted to hyphens after 3.6 update as a duplicate of this one, so we aren't splitting effort to fix the same root problem, as suggested.

bkosborne’s picture

@svenb, the reasoning for going to lowercase is detailed in this issue somewhere (I recall reading it yesterday): https://www.drupal.org/node/1441218 .... These changes were made so that you could insert tokens for the CSS class / ID, so there was an effort to make them more machine-name friendly. So a token for a taxonomy term "My Term" gets converted to "my-term"

bkosborne’s picture

Title: CSS IDs for panes are potentially rewritten in 3.6 update, breaking themes that rely on them » CSS IDs and classes for panes are potentially rewritten in 3.6 update, breaking themes that rely on them
DamienMcKenna’s picture

Status: Active » Needs review
Related issues: +#1441218: Use keyword replacements for CSS settings
japerry’s picture

Status: Needs review » Active
Parent issue: » #2786071: Plan for Panels 7.x-3.7 release
dsnopek’s picture

Status: Active » Needs review
FileSize
1.45 KB

I posted a patch for this same problem on #2785917: Underscores in CSS IDs for panes are converted to hyphens after 3.6 update. Re-posting it here! We're going to release Panopoly with this patch.

dsnopek’s picture

Issue tags: +panopoly
bkosborne’s picture

Status: Needs review » Needs work

The issue here is that CSS classes are converted to lowercase and CSS IDs are run through drupal_html_id. Both are problems for existing panes. The patch addresses the issue with the CSS ID, but not classes.

Will need to examine the original patch that caused these problems to see all the areas that need to be reverted.

bkosborne’s picture

Status: Needs work » Needs review
FileSize
3.09 KB

Here's a patch that removes usage of drupal_html_id and strtolower that was brought in from #1441218: Use keyword replacements for CSS settings. That issue did not properly consider the implication of existing CSS classes or IDs that would be transformed by the new code.

Assuming this is committed, another issue would probably need to be opened to come up with a better way to format the replaced tokens.

bkosborne’s picture

FileSize
3.09 KB

Oops, syntax error.

jackalope’s picture

@bkosborne Thanks for that patch in #16! I've applied it to a local site running Drupal 7.44 (don't ask) and Panels 7.x-3.6; your patch fixes the broken theme for me. I'll test on other sites running Drupal 7.50 but can't imagine that will cause a difference!

jackalope’s picture

Status: Needs review » Reviewed & tested by the community

Happy to report that the patch in #16 applies nicely and fixed the broken theme I encountered on two more Drupal 7.50 sites running Panels 7.x-3.6. Dare I say this is RTBC and ready to commit? :) Thanks again @bkosborne!

karen11’s picture

I also tested patch #16 and it fixed the issues I encountered after installing Panels 7.x-3.6. Thanks @bkosborne!

dsnopek’s picture

Issue tags: +panopoly

RTBC +1!

byronveale’s picture

I can confirm that #16 patch works, for me at least…

Only local images are allowed.

dsnopek’s picture

Discussed this with @japerry at MWDS. He wants to have a working patch on #2787099: Add checkbox to normalize CSS IDs and classes before merging this one.

bkosborne’s picture

Makes sense, don't want to break sites that have been using the token feature either.

  • japerry committed a1daec8 on 7.x-3.x authored by bkosborne
    Issue #2785843 by bkosborne, dsnopek, svenb: CSS IDs and classes for...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Okay we'll look at the normalization in the other patch. Fixed!

Status: Fixed » Closed (fixed)

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