Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.307 diff -u -r1.307 block.module --- modules/block/block.module 26 May 2008 17:12:54 -0000 1.307 +++ modules/block/block.module 28 Jun 2008 17:00:23 -0000 @@ -256,11 +256,16 @@ $blocks[] = $block; } else { - // If it's an existing block, database settings should overwrite - // the code. But aside from 'info' everything that's definable in - // code is stored in the database and we do not store 'info', so we - // do not need to update the database here. - // Add 'info' to this block. + // For existing block, database settings should overwrite the code, + // except for possible changes in the cache mode. + if ((!isset($block['cache']) && $old_blocks[$module][$delta]['cache'] != BLOCK_CACHE_PER_ROLE) || (isset($block['cache']) && $old_blocks[$module][$delta]['cache'] != $block['cache'])) { + $updated_block = array('cache' => isset($block['cache']) ? $block['cache'] : BLOCK_CACHE_PER_ROLE, 'module' => $module, 'delta' => $delta); + drupal_write_record('blocks', $updated_block, array('module', 'delta')); + cache_clear_all("$module:$delta:", 'cache_block', TRUE); + $old_blocks[$module][$delta]['cache'] = $updated_block['cache']; + } + // 'info' is the only thing that's definable in code but not stored + // in the database. $old_blocks[$module][$delta]['info'] = $block['info']; // If the region name does not exist, disable the block and assign it to none. if (!empty($old_blocks[$module][$delta]['region']) && !isset($regions[$old_blocks[$module][$delta]['region']])) {