On further testing my new module I discovered that all the styling disappears for anonymous users. This is drupal 6. What makes it more interesting and more difficult to debug is this does not happen on my development box, only on the production server. In looking into this I've noted that this behaviour is not unknown but those instances I've read about have little in common with mine.
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.
Thanks
Hi
I had a similar (but different) issue recently. In my case I resolved it by opening up permissions on the files/css and files/color directories. It may be that your ownership:permissions model on the development server is different than on the production server.
John
On 16/06/2010, at 8:25 AM, Scott wrote:
On further testing my new module I discovered that all the styling disappears for anonymous users. This is drupal 6. What makes it more interesting and more difficult to debug is this does not happen on my development box, only on the production server. In looking into this I've noted that this behaviour is not unknown but those instances I've read about have little in common with mine.
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.
Thanks
-- [ Drupal support list | http://lists.drupal.org/ ]
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
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):
Make extra-sure your module's enabled on admin/build/modules
Check your drupal_add_css() call. Should look roughly like:
drupal_add_css(drupal_get_path('module', 'MYMODULE') .'/css/MYMODULE.css');
Make sure you're doing drupal_add_css() inside hook_init()
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.
Turn aggregation back on, see if css shows up now
If not, clear cache (admin/settings/performance)
Verify that you don't need to restart memcache/apache/etc, do it if needed
Go back to step 0 and try again
Good luck.
-D
Out of curiosity are you running Boost? If so check to see if Boost is caching the CSS and JS files (I think it does by default). I've had that happened before and just end up turning off CSS an JS handling by Boost.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 6/15/2010 6:25 PM, Scott wrote:
On further testing my new module I discovered that all the styling disappears for anonymous users. This is drupal 6. What makes it more interesting and more difficult to debug is this does not happen on my development box, only on the production server. In looking into this I've noted that this behaviour is not unknown but those instances I've read about have little in common with mine.
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.
Thanks