When a block is cached the javascript and css may not load. This is related to this core issue #214856: CSS and JS for Cached Blocks (drupal_add_css incompatible with blocks) patch to adjust media nivo slider block building to use the #attached

Comments

jgraham’s picture

Status: Active » Needs review
StatusFileSize
new9.48 KB

Sorry about all of the whitespace adjustments... my editor strips trailing whitespace. Pertinent patch lines are 112-117 and 205-220.

This is just removing the calls to drupal_add_css() and drupal_add_js() and replacing them with cache resilient method as described in #214856: CSS and JS for Cached Blocks (drupal_add_css incompatible with blocks).

jgraham’s picture

StatusFileSize
new8.58 KB

Previous patch was broken please use this instead.

jgraham’s picture

StatusFileSize
new8.77 KB

Sorry for the issue spam. This last patch removes one last call to drupal_add_js() so that all js/css will be via #attached which will be cached with the block object.

peronas’s picture

Sorry for the delay on addressing this.

Thanks for the patch jgraham! Patch applied and committed should be in the next dev release that's built.

peronas’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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