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.
I spent quite a considerable amount of time today trying to troubleshoot why the IE Unlimited CC Loader module was no longer behaving as expected on my site until I decided to disable recently enabled modules. The I found out that the culprit was the CCK Fieldgroup module. Luckily enough I don't really need the Fieldgroup function so I just disabled it.
Comment | File | Size | Author |
---|---|---|---|
#13 | unlimited_css.module.debug_.txt | 6.42 KB | donquixote |
Comments
Comment #1
donquixote CreditAttribution: donquixote commentedCould you test the -dev version, and then use var_dump() or dpm() to look into $vars['styles_unlimited_css'] and $vars['styles'] from your themename_preprocess_page(), with cck_fieldgroup enabled ?
Comment #2
sarahjean CreditAttribution: sarahjean commentedVersions:
Drupal core 6.19
Content Construction Kit (CCK) 6.x-2.8
IE Unlimited CSS Loader 6.x-1.x-dev (2010-Nov-12)
File system is set to Private download method, so not able to use stylesheet aggregation settings in Performance
I am having the same issue, I only have problems with stylesheets not loading in the admin pages of the site. The admin theme for the site is Garland. The main site theme is Acquia Marina. I have tried disabling CCK Fieldgroup and that makes Unlimited CSS functional again, but unfortunately I do have need of CCK Fieldgroups so I can't leave it disabled. I tried the dev version of unlimited_css and used dpm() (with Fieldgroups enabled) as you suggested above:
For Garland:
$vars['styles_unlimited_css']
--------------------------------
--------------------------------
$vars['styles']
--------------------------------
--------------------------------
I also tried this setting Acquia Marina as admin theme (results look the same as for non-admin pages):
$vars['styles_unlimited_css']
--------------------------------
--------------------------------
$vars['styles']
--------------------------------
--------------------------------
(edited for code tags)
Comment #3
donquixote CreditAttribution: donquixote commentedInteresting.
So actually the module does run, but it decides that 34 stylesheets are still acceptable.
Could you do some dpm() in unlimited_css_preprocess_page() ?
I am looking at it atm, and it seems like $vars['conditional_styles'] could be the problem. The magic number constraint is only for $styles, but does not count the conditional ones. So this could be what causes the problem. Could you check?
Problem: We don't have the consitional styles in array form, so we would need to count them with substr_count() or preg_match_all().
EDIT:
Maybe instead of dpm(), you could simply insert a html comment saying "<!-- conditional styles -->".
Comment #4
sarahjean CreditAttribution: sarahjean commentedWhen I tried dpm() $vars['styles_unlimited_css'] in unlimited_css_preprocess_page() I got:
With dpm($vars['styles']); it was the same.
I tried inserting:
print "<!-- conditional styles -->";
At the end of the unlimited_css_preprocess_page() function, it displayed right before the doctype declaration in both IE and Firefox. I'm not sure if there was another way that you meant for me to do that, if so let me know and I will try it and let you know what happened.
Comment #5
sarahjean CreditAttribution: sarahjean commentedActually, after clearing the Theme registry with
print "<!-- conditional styles -->"
in place (which I should have done before posting), I can see that only 31 stylesheets are posting, all with<link>
rather than @import. This resulted in portions of Garland displaying, but the page layout is broken from a few missing stylesheets.Here's the CSS links that showed from view source:
Comment #6
sarahjean CreditAttribution: sarahjean commentedSorry, got excited, #5 was with CCK Fieldgroup disabled, with it enabled I don't see any of the Garland styles, here's the stylesheets, looks like only 32 are being added to the page:
Comment #7
donquixote CreditAttribution: donquixote commentedThis will not tell you anything useful.
Instead of print, you should append the comment to the styles string, before the conditional styles. The idea is that you find out how many of the styles are coming from the conditional styles variable.
Comment #8
sarahjean CreditAttribution: sarahjean commentedOK, my PHP is pretty basic, is this where you mean?
Lines 33-37:
Comment #9
donquixote CreditAttribution: donquixote commentedI think that's the place, yes.
Change it to something like this:
Comment #10
sarahjean CreditAttribution: sarahjean commentedI've tried the code above, and I don't see the comment added in the page source, whether it is displaying
<link>
or @import. Does that suggest that it isn't loading conditional_styles?Comment #11
donquixote CreditAttribution: donquixote commentedYeah, seems so. You could play around a bit more, and put more comments into the $styles variable?
Btw, have you tried the -dev version?
I just had a look at the current 1.2 version, and it seems I totally forgot to make a 1.3 release with the changes from -dev. I guess I wanted to get some feedback first, and then moved to other things.
If you find that this problem only happens in -dev, and not in 2.1 (or vice versa), that would be interesting for me to know.
Comment #12
sarahjean CreditAttribution: sarahjean commentedYeah, I am working with the dev version currently, I downloaded that when I started testing this. I'll try out the other versions and see if they fix anything. I do have the module running fine on some other sites, this is one of our older ones and the configuration is a bit of a pain in the neck.
Comment #13
donquixote CreditAttribution: donquixote commentedI really want to see this issue closed, but this won't happen without some further debugging.
Attached you find a modified version of the module file, which will hopefully tell us more.
I have not tested this at all, so feel free to fix obvious syntax errors.
Comment #14
sarahjean CreditAttribution: sarahjean commentedOk, I've added that to the module on my test site. Here's what I see in the source on the admin side with Garland in IE:
And here's what I see in the source on the front page with Acquia Marina:
Let me know what else you would like to see to help debug, or if you need me to test any changes.
Comment #15
donquixote CreditAttribution: donquixote commentedHi,
sorry for letting this sleep for a long time.
Is this still an issue with the current version?