If you enabled "Cache Blocks" and/or "Cache pages for anonymous users" under admin/config/development/performance the content of the block does not load/updated because the simple_weather.js file is not included on the page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rruiz created an issue. See original summary.

larsdesigns’s picture

Good catch. I will work on a fix this week.

rruiz’s picture

Here is the patch.

larsdesigns’s picture

@rruiz, Thank you so much for the patch. But it looks like it does not fix the issue. Also, there is a lot of code added does not relate to the issue. I am pushing up the fix to the dev branch.

It is simply a cache problem in the hook_block_info() implementation.

  • larsdesigns committed 8d3fadc on 7.x-1.x
    #2771435 by rruiz, larsdesigns. Fixing cache issue that prevents the...
larsdesigns’s picture

Assigned: Unassigned » larsdesigns
Status: Active » Fixed

Released 7.x-1.3 with the cache fix.

rruiz’s picture

Why you do not want to cache the block ? The block content never change, always load the same content '

 

'. The content of the block is updated using jQuery (just you need to be sure required javascript files are loading in every page you want to show the block).
When you have a heavy traffic you want to use cache all the time and you do not want to hit your database.
The patch included added a global configuration form and a permission to manage it. You have to enable that permission first. The configuration form is to set in what pages do you want to load the required javascript files to update the block content. Then in the hook_preprocess_html implementation you can load the required javascript using those settings from global configuration.
Even, I think we should use 'cache' => DRUPAL_CACHE_GLOBAL in the hook_block_info() implementation.
I'm using this patch without issues in a prod environment (Load Balancers, Varnish, Memcache, Drupal cache enabled). If we have these resources why do not use cache ?
Thank you for this wonderful module.

Status: Fixed » Closed (fixed)

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