Index: modules/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block.module,v
retrieving revision 1.186
diff -u -r1.186 block.module
--- modules/block.module	3 Nov 2005 15:39:37 -0000	1.186
+++ modules/block.module	6 Nov 2005 02:48:11 -0000
@@ -212,18 +212,26 @@
  * Prepare the main block administration form.
  */
 function block_admin_display() {
-  global $theme_key;
+  global $custom_theme;
   $throttle = module_exist('throttle');
 
+  // If non-default theme configuration has been selected, set the custom theme.
+  if (arg(3)) {
+    $custom_theme = arg(3);
+  } else {
+    $custom_theme = variable_get('theme_default', 'bluemarine');
+  }
+  $theme = init_theme();
+
   $blocks = _block_rehash();
-  $block_regions = system_region_list($theme_key);
+  $block_regions = system_region_list($theme);
 
-  $form['#action'] = arg(3) ? url('admin/block/list/' . $theme_key) : url('admin/block');
+  $form['#action'] = arg(3) ? url('admin/block/list/' . $theme) : url('admin/block');
   $form['#tree'] = TRUE;
   foreach ($blocks as $block) {
     $form[$block['module']][$block['delta']]['info'] = array('#type' => 'markup', '#value' => $block['info']);
     $form[$block['module']][$block['delta']]['status'] = array('#type' => 'checkbox', '#default_value' => $block['status']);
-    $form[$block['module']][$block['delta']]['theme'] = array('#type' => 'hidden', '#value' => $theme_key);
+    $form[$block['module']][$block['delta']]['theme'] = array('#type' => 'hidden', '#value' => $theme);
     $form[$block['module']][$block['delta']]['weight'] = array('#type' => 'weight', '#default_value' => $block['weight']);
     $form[$block['module']][$block['delta']]['region'] = array('#type' => 'select', '#default_value' => isset($block['region']) ? $block['region'] : system_default_region(), '#options' => $block_regions);
 
@@ -241,15 +249,9 @@
 }
 
 function theme_block_admin_display($form) {
-
-  global $theme_key, $custom_theme;
+  global $theme_key;
   $throttle = module_exist('throttle');
 
-  // If non-default theme configuration has been selected, set the custom theme.
-  if (arg(3)) {
-    $custom_theme = arg(3);
-    init_theme();
-  }
   $block_regions = system_region_list($theme_key);
 
   // Highlight regions on page, to provide visual reference.

