Index: entity/entity.ui.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/entity/entity/Attic/entity.ui.inc,v
retrieving revision 1.1.2.12
diff -u -p -r1.1.2.12 entity.ui.inc
--- entity/entity.ui.inc	25 Nov 2010 16:54:28 -0000	1.1.2.12
+++ entity/entity.ui.inc	26 Nov 2010 01:26:59 -0000
@@ -178,12 +178,12 @@ class EntityDefaultUIController {
    *   A renderable array.
    */
   public function overviewTable($conditions = array()) {
-    $entities = entity_load($this->entityType);
-    ksort($entities);
+    $bundles = $this->entityInfo['bundles'];
+    ksort($bundles);
 
     $rows = array();
-    foreach ($entities as $id => $entity) {
-      $rows[] = $this->overviewTableRow($conditions, $id, $entity);
+    foreach ($bundles as $name => $bundle) {
+      $rows[] = $this->overviewTableRow($conditions, $name, $bundle);
     }
     // Assemble the right table header.
     $header = array(t('Label'));
@@ -208,21 +208,22 @@ class EntityDefaultUIController {
   }
 
   /**
-   * Generates the row for the passed entity and may be overridden in order to
-   * customize the rows.
+   * Generates a overview table row for the passed entity bundle.
+   *
+   * May be overridden in order to customize the rows.
    *
    * @param $additional_cols
    *   Additional columns to be added after the entity label column.
    */
-  protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {
-    $entity_uri = entity_uri($this->entityType, $entity);
-
-    $row[] = array('data' => array(
-      '#theme' => 'entity_ui_overview_item',
-      '#label' => entity_label($this->entityType, $entity),
-      '#name' => !empty($this->entityInfo['exportable']) ? entity_id($this->entityType, $entity) : FALSE,
-      '#url' => $entity_uri ? $entity_uri : FALSE,
-      '#entity_type' => $this->entityType),
+  protected function overviewTableRow($conditions, $name, $bundle, $additional_cols = array()) {
+    $row[] = array(
+      'data' => array(
+        '#theme' => 'entity_ui_overview_item',
+        '#label' => $bundle['label'],
+        '#name' => $name,
+        '#entity_type' => $this->entityType,
+        '#bundle' => $bundle,
+      ),
     );
 
     // Add in any passed additional cols.
@@ -231,10 +232,11 @@ class EntityDefaultUIController {
     }
 
     // Add a row for the exportable status.
-    if (!empty($this->entityInfo['exportable'])) {
+    // @todo Doesn't seem to make sense here.
+    if (!empty($this->entityInfo['exportable']) && isset($bundle[$this->statusKey])) {
       $row[] = array('data' => array(
         '#theme' => 'entity_status',
-        '#status' => $entity->{$this->statusKey},
+        '#status' => $bundle[$this->statusKey],
       ));
     }
     // In case this is a bundle, we add links to the field ui tabs.
@@ -246,30 +248,30 @@ class EntityDefaultUIController {
     $colspan = $exportable ? $colspan + 1 : $colspan;
 
     // Add operations depending on the status.
-    if (entity_has_status($this->entityType, $entity, ENTITY_FIXED)) {
-      $row[] = array('data' => l(t('clone'), $this->path . '/manage/' . $id . '/clone'), 'colspan' => $colspan);
+    if (entity_has_status($this->entityType, $bundle, ENTITY_FIXED)) {
+      $row[] = array('data' => l(t('clone'), $this->path . '/manage/' . $name . '/clone'), 'colspan' => $colspan);
     }
     else {
-      $row[] = l(t('edit'), $this->path . '/manage/' . $id);
+      $row[] = l(t('edit'), $this->path . '/manage/' . $name);
 
       if ($field_ui) {
-        $row[] = l(t('manage fields'), $this->path . '/manage/' . $id . '/fields');
-        $row[] = l(t('manage display'), $this->path . '/manage/' . $id . '/display');
+        $row[] = l(t('manage fields'), $this->path . '/manage/' . $name . '/fields');
+        $row[] = l(t('manage display'), $this->path . '/manage/' . $name . '/display');
       }
 
-      $row[] = l(t('clone'), $this->path . '/manage/' . $id . '/clone');
-      if (empty($this->entityInfo['exportable']) || !entity_has_status($this->entityType, $entity, ENTITY_IN_CODE)) {
-        $row[] = l(t('delete'), $this->path . '/manage/' . $id . '/delete', array('query' => drupal_get_destination()));
+      $row[] = l(t('clone'), $this->path . '/manage/' . $name . '/clone');
+      if (empty($this->entityInfo['exportable']) || !entity_has_status($this->entityType, $bundle, ENTITY_IN_CODE)) {
+        $row[] = l(t('delete'), $this->path . '/manage/' . $name . '/delete', array('query' => drupal_get_destination()));
       }
-      elseif (entity_has_status($this->entityType, $entity, ENTITY_OVERRIDDEN)) {
-        $row[] = l(t('revert'), $this->path . '/manage/' . $id . '/revert', array('query' => drupal_get_destination()));
+      elseif (entity_has_status($this->entityType, $bundle, ENTITY_OVERRIDDEN)) {
+        $row[] = l(t('revert'), $this->path . '/manage/' . $name . '/revert', array('query' => drupal_get_destination()));
       }
       else {
         $row[] = '';
       }
     }
     if ($exportable) {
-      $row[] = l(t('export'), $this->path . '/manage/' . $id . '/export');
+      $row[] = l(t('export'), $this->path . '/manage/' . $name . '/export');
     }
     return $row;
   }
