I have a page in the cache containing multiple blocks that get Ajax-ed. I remove one of those blocks from the cache. Javascript fails.

JSON returned is

{ "views-name-block_1": null }

JS error is data[key] is null in

function ajaxify_regions_success_block(data)
{
  for(key in data) {
    var block = $('#block-'+key+'-ajax-content').replaceWith(data[key]['content']);
    Drupal.attachBehaviors(block);
  }
}; 

Rest of the blocks fail to load due to this JS error. Suggest testing for a return value of NULL and having the option of:
* doing nothing
* use no-js fallback
* hiding this block
If I had to pick a default I would go for hiding of the block.

Comments

mikeytown2’s picture

Typo Fix:
"I remove one of those blocks from the cache system."

csevb10’s picture

Status: Active » Fixed

Fixed in commit http://drupal.org/cvs?commit=419696 in the desired way.

Status: Fixed » Closed (fixed)

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