Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.224 diff -u -p -r1.224 block.module --- modules/block/block.module 27 Aug 2006 12:43:18 -0000 1.224 +++ modules/block/block.module 28 Aug 2006 13:25:52 -0000 @@ -180,6 +180,7 @@ function _block_rehash() { $block['custom'] = $old_blocks[$module][$delta]->custom; $block['throttle'] = $old_blocks[$module][$delta]->throttle; $block['title'] = $old_blocks[$module][$delta]->title; + db_query("UPDATE {block} SET theme = '%s', status = %d, weight = %d, region = '%s', visibility = %d, pages = '%s', custom = %d, throttle = %d, title = '%s' WHERE module = '%s' AND delta = '%s'", $theme_key, $block['weight'], $block['region'], $block['pages'], $block['custom'], $block['title'], $block['module'], $block['delta']); } // Otherwise, use any set values, or else substitute defaults. else { @@ -189,6 +190,7 @@ function _block_rehash() { $block[$property] = $default; } } + db_query("INSERT INTO {blocks} (module, delta, weight, region, pages, custom, title) VALUES ('%s', '%s', %d, '%s', '%s', %d, '%s')", $block['module'], $block['delta'], $block['weight'], $block['region'], $block['pages'], $block['custom'], $block['title']); } $blocks[] = $block; @@ -196,16 +198,6 @@ function _block_rehash() { } } - db_lock_table('blocks'); - // Remove all blocks from table. - db_query("DELETE FROM {blocks} WHERE theme = '%s'", $theme_key); - - // Reinsert new set of blocks into table. - foreach ($blocks as $block) { - db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, custom, throttle, title) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d, '%s')", $block['module'], $block['delta'], $theme_key, $block['status'], $block['weight'], $block['region'], $block['visibility'], $block['pages'], $block['custom'], $block['throttle'], $block['title']); - } - db_unlock_tables(); - return $blocks; }