From 9ca602a00fd1fa27a2060c1a3b8f59112a19c322 Mon Sep 17 00:00:00 2001
From: Chris Skene <chris@xtfer.com>
Date: Tue, 18 Oct 2011 12:07:09 +1100
Subject: [PATCH] Write the correct module name when reverting a feature

---
 includes/ds.features.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/includes/ds.features.inc b/includes/ds.features.inc
index ba92367..96558df 100644
--- a/includes/ds.features.inc
+++ b/includes/ds.features.inc
@@ -115,6 +115,9 @@ function ds_features_revert($module = NULL) {
         foreach ($setting as $build_mode => $conf) {

           // Remove old settings.
+          db_query("DELETE FROM {ds_settings} WHERE build_mode = '%s' AND module = '%s' AND type = '%s'", $build_mode, $ds_module, $object_type);
+
+          // Catch situations where the feature name has crept into the table
           db_query("DELETE FROM {ds_settings} WHERE build_mode = '%s' AND module = '%s' AND type = '%s'", $build_mode, $module, $object_type);

           // Iterate over fields and ditch those which are hidden.
@@ -127,7 +130,7 @@ function ds_features_revert($module = NULL) {

           // Save new settings.
           $record = new stdClass();
-          $record->module = $module;
+          $record->module = $ds_module;
           $record->type = $object_type;
           $record->build_mode = $build_mode;
           $record->settings = serialize($conf);
--
1.7.5.4

