[support] CSS lost for anonymous users
Scott
scott at bscottholmes.com
Wed Jun 16 15:33:16 UTC 2010
I was calling drupal_add_css from hook_block(). I created the
hook_init() function and placed the call there. It works fine now.
Thanks for the heads up on that.
On Tue, 2010-06-15 at 23:48 -0700, Domenic Santangelo wrote:
> On Jun 15, 2010, at 3:25 PM, Scott wrote:
> > Any thoughts on what I should look for? I've gone ahead and moved the
> > module style sheet into the theme directory so all appears okay now but
> > I'd like the module to be stand alone as I've submitted it for
> > consideration to the drupal community.
>
> Thoughts in the order I'd check (some or all may not apply):
>
> 0. Make extra-sure your module's enabled on admin/build/modules
>
> 1. Check your drupal_add_css() call. Should look roughly like:
> drupal_add_css(drupal_get_path('module', 'MYMODULE') .'/css/MYMODULE.css');
>
> 2. Make sure you're doing drupal_add_css() inside hook_init()
>
> 3. Test with css aggregation (admin/settings/performance) turned OFF on production and verify that your css appears in the head tag. If it doesn't, sanity check: make sure you're updating production code correctly (a simple comment in page.tpl.php or your main stylesheet works), check the watchdog for obvious errors.
>
> 4. Turn aggregation back on, see if css shows up now
>
> 5. If not, clear cache (admin/settings/performance)
>
> 6. Verify that you don't need to restart memcache/apache/etc, do it if needed
>
> 7. Go back to step 0 and try again
>
> Good luck.
>
> -D
>
>
More information about the support
mailing list