? 540584-domain-source.patch
? 561282-views-filtering.patch
? 576444-select-list-format.patch
? 597654-theme.patch
Index: domain_theme/domain_theme.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_theme/domain_theme.admin.inc,v
retrieving revision 1.7
diff -u -p -r1.7 domain_theme.admin.inc
--- domain_theme/domain_theme.admin.inc	23 Jul 2009 16:51:36 -0000	1.7
+++ domain_theme/domain_theme.admin.inc	7 Oct 2009 14:31:08 -0000
@@ -284,9 +284,10 @@ function domain_theme_settings_submit($f
   $values = $form_state['values'];
   $filepath = NULL;
   $reset = FALSE;
+  $form_state['redirect'] = 'admin/build/domain/theme/'. $values['domain_id'];
+  $domain = domain_lookup($values['domain_id']);
   if ($values['op'] == $values['reset']) {
     db_query("DELETE FROM {domain_theme} WHERE domain_id = %d AND theme = '%s'", $values['domain_id'], $values['theme']);
-    $domain = domain_lookup($values['domain_id']);
     drupal_set_message(t('The %theme settings for %domain have been reset.', array('%theme' => $values['theme'], '%domain' => $domain['sitename'])));
     $reset = TRUE;
   }
@@ -341,4 +342,10 @@ function domain_theme_settings_submit($f
     }
     drupal_set_message(t('The configuration options have been saved.'));
   }
+  // If nothing is active, then we make this one active.
+  $active = db_result(db_query("SELECT COUNT(*) FROM {domain_theme} WHERE domain_id = %d AND status = 1", $domain_id));
+  if (empty($active)) {
+    db_query("UPDATE {domain_theme} SET status = 1 WHERE domain_id = %d AND theme = '%s'", $domain_id, $theme);
+    drupal_set_message(t('%theme has been set as the default theme for %domain', array('%theme' => $theme, '%domain' => $domain['sitename'])));
+  }
 }
Index: domain_theme/domain_theme.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_theme/domain_theme.module,v
retrieving revision 1.16
diff -u -p -r1.16 domain_theme.module
--- domain_theme/domain_theme.module	13 Jun 2009 20:02:40 -0000	1.16
+++ domain_theme/domain_theme.module	7 Oct 2009 14:31:08 -0000
@@ -238,12 +238,14 @@ function domain_theme_domainbatch() {
 function domain_theme_batch($values) {
   foreach ($values['domain_batch'] as $key => $value) {
     if ($key > 0) {
-      $data = db_fetch_array(db_query("SELECT theme FROM {domain_theme} WHERE domain_id = %d", $key));
+      // Clear out the old theme.
+      db_query("UPDATE {domain_theme} SET status = 0 WHERE domain_id = %d", $key);
+      $data = db_fetch_array(db_query("SELECT theme FROM {domain_theme} WHERE theme = '%s' AND domain_id = %d", $value, $key));
       if (isset($data['theme'])) {
-        db_query("UPDATE {domain_theme} SET theme = '%s' WHERE domain_id = %d", $value, $key);
+        db_query("UPDATE {domain_theme} SET status = 1 WHERE theme = '%s' AND domain_id = %d", $value, $key);
       }
       else {
-        db_query("INSERT INTO {domain_theme} (domain_id, theme) VALUES (%d, '%s')", $key, $value);
+        db_query("INSERT INTO {domain_theme} (domain_id, theme, status) VALUES (%d, '%s', 1)", $key, $value);
       }
     }
     else {
