? faceted_search-706030-2.patch
? faceted_search-706030-exportable_delta.patch
? faceted_search.features.inc
Index: faceted_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/faceted_search/faceted_search.module,v
retrieving revision 1.56
diff -u -p -r1.56 faceted_search.module
--- faceted_search.module	4 May 2009 23:08:03 -0000	1.56
+++ faceted_search.module	21 Mar 2010 19:21:48 -0000
@@ -7,6 +7,7 @@
  */
 
 require_once('./'. drupal_get_path('module', 'faceted_search') .'/faceted_search.inc');
+include 'faceted_search.features.inc';
 
 /**
  * Implementation of hook_help().
Index: faceted_search_ui.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/faceted_search/faceted_search_ui.module,v
retrieving revision 1.89
diff -u -p -r1.89 faceted_search_ui.module
--- faceted_search_ui.module	15 Mar 2010 19:05:16 -0000	1.89
+++ faceted_search_ui.module	21 Mar 2010 19:21:49 -0000
@@ -37,7 +37,7 @@ function faceted_search_ui_menu() {
   // first. This causes an error message. The real issue is the module
   // dependency tree being ignored when uninstalling
   // (http://drupal.org/node/151452).
-  
+
   $items = array();
   foreach (faceted_search_get_env_ids() as $env_id) {
     $env = faceted_search_env_load($env_id);
@@ -85,31 +85,31 @@ function faceted_search_ui_block($op = '
     foreach (faceted_search_get_env_ids() as $env_id) {
       $env = faceted_search_env_load($env_id);
       if ($env->settings['current_block']) {
-        $blocks[$env_id .'_current'] = array(
+        $blocks[$env->name .'_current'] = array(
           'info' => t('@env - Current search', array('@env' => $env->name)),
           'cache' => BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_USER,
         );
       }
       if ($env->settings['keyword_block']) {
-        $blocks[$env_id .'_keyword'] = array(
+        $blocks[$env->name .'_keyword'] = array(
           'info' => t('@env - Keyword search', array('@env' => $env->name)),
           'cache' => BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE,
         );
       }
       if ($env->settings['guided_block']) {
-        $blocks[$env_id .'_guided'] = array(
+        $blocks[$env->name .'_guided'] = array(
           'info' => t('@env - Guided search', array('@env' => $env->name)),
           'cache' => BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_USER,
         );
       }
       if ($env->settings['related_block']) {
-        $blocks[$env_id .'_related'] = array(
+        $blocks[$env->name .'_related'] = array(
           'info' => t('@env - Related categories', array('@env' => $env->name)),
           'cache' => BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_USER,
         );
       }
       if ($env->settings['sort_block']) {
-        $blocks[$env_id .'_sort'] = array(
+        $blocks[$env->name .'_sort'] = array(
           'info' => t('@env - Sort options', array('@env' => $env->name)),
           'cache' => BLOCK_CACHE_PER_PAGE,
         );
@@ -119,7 +119,11 @@ function faceted_search_ui_block($op = '
   }
   elseif ($op == 'view' && user_access('use faceted search')) {
     // Determine the environment id and requested block.
-    list($env_id, $delta) = explode('_', $delta, 2);
+    $parts = explode('_', $delta);
+    $delta = array_pop($parts);
+    $name = implode('_', $parts);
+    $result = db_fetch_object(db_query("SELECT * FROM {faceted_search_env} WHERE name = '%s'", $name));
+    $env_id = $result->env_id;
 
     $env = faceted_search_env_load($env_id);
     if (!$env || $env->ui_state['stage'] == 'select' || ($env->ui_state['stage'] == 'facet' && $delta != 'sort')) {
@@ -133,9 +137,9 @@ function faceted_search_ui_block($op = '
       $env->prepare();
       $env->execute();
     }
-    
+
     faceted_search_ui_add_css();
-    
+
     switch ($delta) {
       case 'current':
         $block['subject'] = t('Current search');
@@ -183,7 +187,7 @@ function faceted_search_ui_form_faceted_
     '#title' => t('Base path'),
     '#default_value' => $env->settings['base_path'],
     '#required' => TRUE,
-    '#description' => t('The base path under which this faceted search environment will be accessed. All faceted search links will be derived from that base path. Do not begin or end the base path with a /. Be careful to assign each faceted search environment its own distinct path.'), 
+    '#description' => t('The base path under which this faceted search environment will be accessed. All faceted search links will be derived from that base path. Do not begin or end the base path with a /. Be careful to assign each faceted search environment its own distinct path.'),
   );
   $form['info']['start_page'] = array( // TODO: Proper validation of the path.
     '#type' => 'textfield',
@@ -366,7 +370,7 @@ function faceted_search_ui_stage_results
   }
 
   $env = faceted_search_env_load($env_id);
-  
+
   // Initialize the current search.
   $env->prepare($text);
   $env->ui_state['stage'] = 'results';
@@ -413,7 +417,7 @@ function faceted_search_ui_stage_select(
   }
 
   $env = faceted_search_env_load($env_id);
-  
+
   // Initialize the current search.
   $env->prepare($text);
   $env->ui_state['stage'] = 'select';
@@ -449,7 +453,7 @@ function faceted_search_ui_stage_facet($
   }
 
   $env = faceted_search_env_load($env_id);
-  
+
   // Initialize the current search.
   $env->prepare($text);
   $env->ui_state['stage'] = 'facet';
@@ -493,7 +497,7 @@ function faceted_search_ui_stage_categor
   }
 
   $env = faceted_search_env_load($env_id);
-  
+
   // Initialize the current search.
   $env->prepare($text);
   $env->ui_state['stage'] = 'categories';
