Answers.Body: <p>Check what caching you have set up in Drupal. My suspicion is that aggressive caching somewhere is taking a snapshot of the head on a non-Civi page (since that's most of your site) and presuming that it's the universal header.</p>
  
  <p>You might try disabling all caching and see whether it continues to break an hour or two after you clear your caches. Alternatively, look through any cache modules or services you've got and think whether it might cause this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-16T15:28:04.300Z
Answers.Text: That's I'll try caching.  Her's the modules list.  block_query     ckeditor        date_repeat_presets  fences            menu_block         nodesinblock  relation       views
  ..              boxes           ckeditor_swf    delta                getid3            menu_import        omega_tools   scanner        views_boxes
  addressfield    cck_blocks      content_
Answers.UserDisplayName: CiviTeacher
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-16T15:29:45.737Z
Answers.Text: access  devel                google_analytics  metatag            pathauto      site_map       views_slideshow
  admin_menu      cctags          context         elfinder             jquery_update     metatags_quick     print         superfish      wysiwyg
  backup_migrate  civicrm         ctools          email                libraries         nodequeue          README.txt    taxonomy_menu
  block_class     civicrm_cicero  date            entity_autocomplete  link              nodereference_url  references    token
Answers.UserDisplayName: CiviTeacher
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-18T22:52:41.667Z
Answers.Text: None of those looks like an obvious problem, but I don't know for sure.  Even just turning off everything you can find on the Performance page would be worth a shot.  Also, you may see caching data in the response header if you use Firebug.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-19T06:35:33.680Z
Answers.Text: I was unable to locate why the problem kept recurring every few hours and specifically why truncating the cache_bootstrap table solved the problem reliably each time.  Module incompatibility was apparently not a factor.  I eventually write a script to clear drupal cache ever 30 minutes and that provided a solution to the problem, even if the cause remains unknown.  https://www.webmaster.net/tutorials/drupal/how-clear-drupal-cache-every-30-minutes-cronjob.html
Answers.UserDisplayName: CiviTeacher
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-16T13:56:53.720Z
Answers.LastActivityDate: 2015-07-16T13:56:53.720Z
Answers.UserDisplayName: Andie Hunt
Answers.Body: <p>Civi's core resources (styles and scripts) are added at runtime so you probably won't gain anything by disabling/enabling the civicrm module in Drupal. But since you are able to reproduce the problem somewhat reliably, I'd suggest you put a debug/logging statement in a couple places in the file civicrm.module. Namely:</p>
  
  <ul>
  <li>In the function <code>civicrm_html_head()</code> to ensure it's being called.</li>
  <li>In the function <code>civicrm_initialize()</code> - look for the line where it says <code>drupal_add_html_head($header);</code>. That's the key bit so you definitely want to make sure that function is getting called.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-16T15:25:45.987Z
Answers.Text: Thanks Coleman.  Here's a result of some testing.  It looks like addCoreResources is getting called, it's just not showing up on the page.  I think this is Drupal's problem, not Civi's.  (see new screenshot at the first post)
Answers.UserDisplayName: CiviTeacher
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-17T17:27:36.030Z
Answers.Text: Hi @Coleman.  Here's another interesting info.  Removing this drupal db row specifically fixes the problem: cache_bootstrap.cid where cid = "module_implements".   What confuses me is that the function civicrm_html_head() does appear to be getting called, even when the jQuery fails to load (see screenshot above).  Thoughts?
Answers.UserDisplayName: CiviTeacher
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-15T20:58:43.277Z
Answers.LastActivityDate: 2015-07-15T20:58:43.277Z
Answers.UserDisplayName: Coleman
Body: <p>Drupal 7 is not loading Civi 4.4's resources: CSS &amp; jQuery.  Clearing Drupal cache solves the problem, for a few hours, then it happens again.  I've tried the following:</p>
  
  <ol>
  <li>custom theme? nope, it's happening in Seven or Garland</li>
  <li>resource URLs in CiviCRM are correct</li>
  <li>disabled and re-enabled Civi as a module, no permanent solution.</li>
  <li>disabled other modules like jQuery Update or Admin Menu </li>
  <li>Turning off Drupal cache, CSS and jQuery aggregation.  It has no effect, even though clearing Drupal's cache solves the problem.  </li>
  </ol>
  
  <p>Note it's not a conflict between js, the Civi resources <em>simply aren't loading</em>. </p>
  
  <p>This started happening after an upgrade from 4.2 to 4.4.  Any ideas for help?</p>
  
  <p><img src="https://i.sstatic.net/S9Y15.png" alt="no resources">
  <img src="https://i.sstatic.net/uAJ3e.png" alt="missing javascript"></p>
  
  <p><img src="https://i.sstatic.net/mUHZi.png" alt="Getting Called"></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-15T19:15:43.330Z
Comments.Text: It's tricky given the lack of reproducibility. Is upgrading to 4.6 not an option?
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-15T20:21:49.650Z
Comments.Text: Intermittent perhaps isn't the best word, and the bug is reproducible.  I clear Drupal cache, and Civi loads its resources and works.  I log out, I wait a few hours, log back in and Civi's not working again.  4.6 is sadly not an option, they have extensions that require 4.4.  Any ideas?  Would uninstalling CiviCRM as a Drupal module (and removing its entry from the 'system' table) do something?
Comments.UserDisplayName: CiviTeacher
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-15T20:37:16.250Z
Comments.Text: Well it would certainly do "something" ;)  As for actually solving your problem... still not sure but will let you know if I get any bright ideas.
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-15T20:41:10.503Z
Comments.Text: Ok.  ;-)  Seriously though, what affect does it have to 1) first disable Civi as a module and then 2) remove the 'civicrm' entry from the 'system' table.  Is it the same as clicking Uninstall from within Drupal?  It doesn't affect the civicrm separate database, but might correct erroneous information Drupal is storing, wouldn't it?
Comments.UserDisplayName: CiviTeacher
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-01T12:27:57.163Z
Comments.Text: Did you ever find out why this is happening? I have the same issue with 2 setups I have. One running with Civi 4.6.8 and Drupal 7.39 and one with Civi 4.5.8 and Drupal 7.34. That whole chunk of @import stuff just isn't in page source. Turning off caching and clearing cache makes no difference. Thanks
Comments.UserDisplayName: Katy J
Tags: <drupal>
Title: Drupal not loading Civi's CSS and jQuery
ThreadText: # Drupal not loading Civi's CSS and jQuery
  
  (Asked by: username_0 on 2015-07-15)
  
  Drupal 7 is not loading Civi 4.4's resources: CSS & jQuery. Clearing Drupal cache solves the problem, for a few hours, then it happens again. I've tried the following:
  
  1. custom theme? nope, it's happening in Seven or Garland
  2. resource URLs in CiviCRM are correct
  3. disabled and re-enabled Civi as a module, no permanent solution.
  4. disabled other modules like jQuery Update or Admin Menu
  5. Turning off Drupal cache, CSS and jQuery aggregation. It has no effect, even though clearing Drupal's cache solves the problem.
  
  Note it's not a conflict between js, the Civi resources *simply aren't loading*.
  
  This started happening after an upgrade from 4.2 to 4.4. Any ideas for help?
  
  ![no resources](https://i.sstatic.net/S9Y15.png)
  ![missing javascript](https://i.sstatic.net/uAJ3e.png)
  
  ![Getting Called](https://i.sstatic.net/mUHZi.png)
  
  **Tags:** drupal
  
  > **Comments:**
  > **username_1**: It's tricky given the lack of reproducibility. Is upgrading to 4.6 not an option?  
  > **username_0**: Intermittent perhaps isn't the best word, and the bug is reproducible.  I clear Drupal cache, and Civi loads its resources and works.  I log out, I wait a few hours, log back in and Civi's not working again.  4.6 is sadly not an option, they have extensions that require 4.4.  Any ideas?  Would uninstalling CiviCRM as a Drupal module (and removing its entry from the 'system' table) do something?  
  > **username_1**: Well it would certainly do "something" ;)  As for actually solving your problem... still not sure but will let you know if I get any bright ideas.  
  > **username_0**: Ok.  ;-)  Seriously though, what affect does it have to 1) first disable Civi as a module and then 2) remove the 'civicrm' entry from the 'system' table.  Is it the same as clicking Uninstall from within Drupal?  It doesn't affect the civicrm separate database, but might correct erroneous information Drupal is storing, wouldn't it?  
  > **username_2**: Did you ever find out why this is happening? I have the same issue with 2 setups I have. One running with Civi 4.6.8 and Drupal 7.39 and one with Civi 4.5.8 and Drupal 7.34. That whole chunk of @import stuff just isn't in page source. Turning off caching and clearing cache makes no difference. Thanks  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-07-16. Score: 2 | Accepted answer
  
  Check what caching you have set up in Drupal. My suspicion is that aggressive caching somewhere is taking a snapshot of the head on a non-Civi page (since that's most of your site) and presuming that it's the universal header.
  
  You might try disabling all caching and see whether it continues to break an hour or two after you clear your caches. Alternatively, look through any cache modules or services you've got and think whether it might cause this.
  
  > **Comments:**
  > **username_0**: That's I'll try caching.  Her's the modules list.  block_query     ckeditor        date_repeat_presets  fences            menu_block         nodesinblock  relation       views ..              boxes           ckeditor_swf    delta                getid3            menu_import        omega_tools   scanner        views_boxes addressfield    cck_blocks      content_  
  > **username_0**: access  devel                google_analytics  metatag            pathauto      site_map       views_slideshow admin_menu      cctags          context         elfinder             jquery_update     metatags_quick     print         superfish      wysiwyg backup_migrate  civicrm         ctools          email                libraries         nodequeue          README.txt    taxonomy_menu block_class     civicrm_cicero  date            entity_autocomplete  link              nodereference_url  references    token  
  > **username_3**: None of those looks like an obvious problem, but I don't know for sure.  Even just turning off everything you can find on the Performance page would be worth a shot.  Also, you may see caching data in the response header if you use Firebug.  
  > **username_0**: I was unable to locate why the problem kept recurring every few hours and specifically why truncating the cache_bootstrap table solved the problem reliably each time.  Module incompatibility was apparently not a factor.  I eventually write a script to clear drupal cache ever 30 minutes and that provided a solution to the problem, even if the cause remains unknown.  https://www.webmaster.net/tutorials/drupal/how-clear-drupal-cache-every-30-minutes-cronjob.html  
  
  ---
  
  ### Answer by username_1 on 2015-07-15. Score: 1
  
  Civi's core resources (styles and scripts) are added at runtime so you probably won't gain anything by disabling/enabling the civicrm module in Drupal. But since you are able to reproduce the problem somewhat reliably, I'd suggest you put a debug/logging statement in a couple places in the file civicrm.module. Namely:
  
  * In the function `civicrm_html_head()` to ensure it's being called.
  * In the function `civicrm_initialize()` - look for the line where it says `drupal_add_html_head($header);`. That's the key bit so you definitely want to make sure that function is getting called.
  
  > **Comments:**
  > **username_0**: Thanks username_1.  Here's a result of some testing.  It looks like addCoreResources is getting called, it's just not showing up on the page.  I think this is Drupal's problem, not Civi's.  (see new screenshot at the first post)  
  > **username_0**: Hi @username_1.  Here's another interesting info.  Removing this drupal db row specifically fixes the problem: cache_bootstrap.cid where cid = "module_implements".   What confuses me is that the function civicrm_html_head() does appear to be getting called, even when the jQuery fails to load (see screenshot above).  Thoughts?  
  
  ---
  
  