### Eclipse Workspace Patch 1.0
#P d6-multisite
Index: public_html/sites/all/modules/contrib/install_profile_api/core/block.inc
===================================================================
--- public_html/sites/all/modules/contrib/install_profile_api/core/block.inc	(revision 8517)
+++ public_html/sites/all/modules/contrib/install_profile_api/core/block.inc	(working copy)
@@ -8,10 +8,6 @@
     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')", 
        $module, $delta, $theme, $status, $weight, $region, $visibility, $pages, $custom, $throttle, $title);
-    if ($module == 'block') {
-      $box = db_fetch_object(db_query('SELECT * FROM {boxes} WHERE bid=%d', $delta));
-      db_query("INSERT INTO {boxes} (bid, body, info, format) VALUES (%d, '%s', '%s', '%s')", $box->bid, $box->body, $box->info, $box->format);
-    }
   }
   else {
     db_query("UPDATE {blocks} SET status = 0 WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme); 
@@ -24,3 +20,21 @@
 function install_add_block_role($module, $delta, $rid) {
   db_query("INSERT INTO {blocks_roles} (module,delta,rid) VALUES ('%s', '%s', %d)", $module, $delta, $rid);
 }
+
+/**
+ * Create a custom block (box), mostly copied from block_add_block_form_submit
+ * 
+ * @return the new block's delta
+ */
+function install_create_custom_block($body, $subject, $format) {
+  db_query("INSERT INTO {boxes} (body, info, format) VALUES ('%s', '%s', %d)", $body, $subject, $format);
+  $delta = db_last_insert_id('boxes', 'bid');
+
+  foreach (list_themes() as $key => $theme) {
+    if ($theme->status) {
+      install_add_block('block', $delta, $theme->name, 0);
+    }
+  }
+
+  return $delta;
+}
\ No newline at end of file
