diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-04 16:39:22 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-04 16:39:22 +0000 |
commit | 7177227536835a50a24ffeb26459e41937ddcd97 (patch) | |
tree | c8abcf88a1555eebd4de167700ac20da8893f4a2 /modules/system/system.install | |
parent | e16be08d5553d3f8835b015260b1660da8c72693 (diff) | |
download | brdo-7177227536835a50a24ffeb26459e41937ddcd97.tar.gz brdo-7177227536835a50a24ffeb26459e41937ddcd97.tar.bz2 |
#197500 reported by webernet, patch by myself and chx: instead of calling into the Drupal API with _block_rehash(), implement what we need from that right there in system_update_6027
Diffstat (limited to 'modules/system/system.install')
-rw-r--r-- | modules/system/system.install | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index 70dc670b2..810d1a005 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -2463,25 +2463,17 @@ function system_update_6027() { // The cache_block table is created in update_fix_d6_requirements() since // calls to cache_clear_all() would otherwise cause warnings. - // Fill in the values for the new 'cache' column, - // by refreshing the {blocks} table. - global $theme, $custom_theme; - $old_theme = $theme; - $themes = list_themes(); - - $result = db_query("SELECT DISTINCT theme FROM {blocks}"); - while ($row = db_fetch_array($result)) { - if (array_key_exists($row['theme'], $themes)) { - // Set up global values so that _blocks_rehash() - // operates on the expected theme. - $theme = NULL; - $custom_theme = $row['theme']; - _block_rehash(); + // Fill in the values for the new 'cache' column in the {blocks} table. + foreach (module_list() as $module) { + if ($module_blocks = module_invoke($module, 'block', 'list')) { + foreach ($module_blocks as $delta => $block) { + if (isset($block['cache'])) { + db_query("UPDATE {blocks} SET cache = %d WHERE module = '%s' AND delta = %d", $block['cache'], $module, $delta); + } + } } } - $theme = $old_theme; - return $ret; } |