diff --git a/domain_alias/domain_alias.features.inc b/domain_alias/domain_alias.features.inc index 256070a..9610998 100644 --- a/domain_alias/domain_alias.features.inc +++ b/domain_alias/domain_alias.features.inc @@ -95,14 +95,17 @@ function domain_alias_features_rebuild($module) { if (!$domain_id) { continue; } + // Delete existing alias records. + db_delete('domain_alias') + ->condition('domain_id', $domain_id) + ->execute(); // Save the new alias records. - if (empty($list)) { - // @todo: delete the records. - } - foreach ($list as $alias) { - $alias['domain_id'] = $domain_id; - $alias['pattern'] = _domain_alias_placeholders_to_sql($alias['pattern']); - drupal_write_record('domain_alias', $alias); + if (!empty($list)) { + foreach ($list as $alias) { + $alias['domain_id'] = $domain_id; + $alias['pattern'] = _domain_alias_placeholders_to_sql($alias['pattern']); + drupal_write_record('domain_alias', $alias); + } } } } diff --git a/domain_conf/domain_conf.features.inc b/domain_conf/domain_conf.features.inc index ff36b29..8c6d2ae 100644 --- a/domain_conf/domain_conf.features.inc +++ b/domain_conf/domain_conf.features.inc @@ -89,15 +89,18 @@ function domain_conf_features_rebuild($module) { if (!$domain_id) { continue; } + // Delete existing conf records. + db_delete('domain_conf') + ->condition('domain_id', $domain_id) + ->execute(); // Save the new records. - if (empty($variables)) { - // @todo: delete the record. + if (!empty($variables)) { + $record = array( + 'domain_id' => $domain_id, + 'settings' => serialize($variables), + ); + drupal_write_record('domain_conf', $record); } - $record = array( - 'domain_id' => $domain_id, - 'settings' => serialize($variables), - ); - drupal_write_record('domain_conf', $record); } } } diff --git a/domain_theme/domain_theme.features.inc b/domain_theme/domain_theme.features.inc index 33ae0a1..11653f7 100644 --- a/domain_theme/domain_theme.features.inc +++ b/domain_theme/domain_theme.features.inc @@ -95,18 +95,22 @@ function domain_theme_features_rebuild($module) { if (!$domain_id) { continue; } - if (empty($themes)) { - // @todo: delete the record. - } - foreach ($themes as $theme) { - $record = array( - 'domain_id' => $domain_id, - 'theme' => $theme['theme'], - 'settings' => serialize($theme['settings']), - 'status' => $theme['status'], - 'filepath' => $theme['filepath'], - ); - drupal_write_record('domain_theme', $record); + // Delete existing theme settings. + db_delete('domain_theme') + ->condition('domain_id', $domain_id) + ->execute(); + // Save the new theme settings. + if (!empty($themes)) { + foreach ($themes as $theme) { + $record = array( + 'domain_id' => $domain_id, + 'theme' => $theme['theme'], + 'settings' => serialize($theme['settings']), + 'status' => $theme['status'], + 'filepath' => $theme['filepath'], + ); + drupal_write_record('domain_theme', $record); + } } } }