From 0ac8abb27f52669e1375fea2e11389e58315bb61 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 22 Aug 2009 13:25:37 +0000 Subject: - Patch #137072 by ksenzee, rernst: block titles not copied on switching to a new theme. --- modules/block/block.module | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/block/block.module b/modules/block/block.module index 97ab8dafb..e0c34d2ec 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -511,16 +511,15 @@ function block_theme_initialize($theme) { $default_theme = variable_get('theme_default', 'garland'); $regions = system_region_list($theme); $result = db_query("SELECT * FROM {block} WHERE theme = :theme", array(':theme' => $default_theme), array('fetch' => PDO::FETCH_ASSOC)); - $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'visibility', 'pages', 'custom', 'cache')); foreach ($result as $block) { // If the region isn't supported by the theme, assign the block to the theme's default region. if (!array_key_exists($block['region'], $regions)) { $block['region'] = system_default_region($theme); } $block['theme'] = $theme; - $query->values($block); + unset($block['bid']); + drupal_write_record('block', $block); } - $query->execute(); } } -- cgit v1.2.3