Index: views_attach.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_attach/views_attach.module,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 views_attach.module
--- views_attach.module	13 Feb 2009 20:43:10 -0000	1.1.2.6
+++ views_attach.module	20 Feb 2009 21:04:12 -0000
@@ -107,6 +107,7 @@
           );
         }
       }
+      break;
   }
 }
 
@@ -187,8 +188,8 @@
         list($view, $display_id) = $data;
         foreach ($view->display_handler->get_option('types') as $type_to_use) {
           $modes = $view->display_handler->get_option('modes');
-          foreach ($modes as $key => $value) {
-            $used_views[$type_to_use][$key][] = array('name' => $view->name, 'display' => $display_id, 'title' => $view->get_title());
+          foreach ($modes as $value) {
+            $used_views[$type_to_use][$value][] = array('name' => $view->name, 'display' => $display_id, 'title' => $view->get_title());
           }
         }
         $view->destroy();
Index: views_attach_plugin_display_node_content.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views_attach/views_attach_plugin_display_node_content.inc,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 views_attach_plugin_display_node_content.inc
--- views_attach_plugin_display_node_content.inc	13 Feb 2009 20:43:10 -0000	1.1.2.6
+++ views_attach_plugin_display_node_content.inc	20 Feb 2009 20:51:12 -0000
@@ -40,14 +40,12 @@
       'value' => implode(', ', $types),
     );
 
-    // content_build_modes() returns data in a horribly inconsistent fashion,
-    // so we have to manually re-lookup the correct labels for the used build modes.
+    $used_modes = $this->get_option('modes');
+    // Get the human readable names.
     $modes = views_attach_build_modes();
-    $used_modes = array_unique(array_filter($this->get_option('modes')));
-    foreach ($used_modes as $key => $mode) {
-      $display_modes[$key] = $modes[$mode];
+    foreach ($used_modes as $mode) {
+      $display_modes[] = $modes[$mode];
     }
-
     $options['modes'] = array(
       'category' => 'node_content',
       'title' => t('Build modes'),
@@ -133,7 +131,8 @@
         $this->set_option('types', array_filter($form_state['values']['types']));
         break;
       case 'modes':
-        $this->set_option('modes', $form_state['values']['modes']);
+        $this->set_option('modes', array_values(array_filter($form_state['values']['modes'])));
+        break;
       case 'default_argument':
         $this->set_option('default_argument', $form_state['values']['default_argument']);
         break;
