### Eclipse Workspace Patch 1.0
#P drupal_test_7
Index: modules/field/field.info.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.info.inc,v
retrieving revision 1.6
diff -u -r1.6 field.info.inc
--- modules/field/field.info.inc	5 Jun 2009 18:25:41 -0000	1.6
+++ modules/field/field.info.inc	19 Jun 2009 01:07:24 -0000
@@ -131,8 +131,8 @@
           // If no bundle key provided, then we assume a single bundle, named
           // after the type of the object. Make sure the bundle created
           // has the human-readable name we need for bundle messages.
-          if (empty($fieldable_info['bundle key'])) {
-            $fieldable_info['bundles'] = array($name => $fieldable_info['name']);
+          if (empty($fieldable_info['bundle key']) && empty($fieldable_info['bundles'])) {
+            $fieldable_info['bundles'] = array($name => array('label' => $fieldable_info['name']));
           }
           $info['fieldable types'][$name] = $fieldable_info;
           $info['fieldable types'][$name]['module'] = $module;
@@ -363,7 +363,7 @@
 }
 
 /**
- * Identity the type of entity that created a bundle.
+ * Identify the type of entity that created a bundle.
  * // TODO : might not be needed depending on how we solve
  * // the 'namespace bundle names' issue
  */
Index: modules/field/field.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v
retrieving revision 1.14
diff -u -r1.14 field.api.php
--- modules/field/field.api.php	6 Jun 2009 16:17:30 -0000	1.14
+++ modules/field/field.api.php	19 Jun 2009 01:07:24 -0000
@@ -39,17 +39,26 @@
 function hook_fieldable_info() {
   $return = array(
     'node' => array(
+      // TODO : label
       'name' => t('Node'),
       'id key' => 'nid',
       'revision key' => 'vid',
       'bundle key' => 'type',
-      // Node.module handles its own caching.
-      'cacheable' => FALSE,
-      // Bundles must provide human readable name so
-      // we can create help and error messages about them.
-      'bundles' => node_type_get_names(),
+      'bundles' => array(),
     ),
   );
+  // Bundles must provide a human readable name so we can create help and error
+  // messages, and the path to attach Field admin pages to.
+  foreach (node_type_get_names() as $type => $name) {
+    $return['bundles'][$type] = array(
+      'label' => $name,
+      'admin' => array(
+        'path' => 'admin/build/node-type/' . str_replace('_', '-', $type),
+        'bundle_arg' => 3,
+        'access arguments' => array('administer content types'),
+      ),
+    );
+  }
   return $return;
 }
 
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1071
diff -u -r1.1071 node.module
--- modules/node/node.module	18 Jun 2009 21:19:02 -0000	1.1071
+++ modules/node/node.module	19 Jun 2009 01:07:25 -0000
@@ -163,11 +163,21 @@
       'bundle key' => 'type',
       // Node.module handles its own caching.
       // 'cacheable' => FALSE,
-      // Bundles must provide human readable name so
-      // we can create help and error messages about them.
-      'bundles' => node_type_get_names(),
+      'bundles' => array(),
     ),
   );
+  // Bundles must provide a human readable name so we can create help and error
+  // messages, and the path to attach Field admin pages to.
+  foreach (node_type_get_names() as $type => $name) {
+    $return['node']['bundles'][$type] = array(
+      'label' => $name,
+      'admin' => array(
+        'path' => 'admin/build/node-type/' . str_replace('_', '-', $type),
+        'bundle_arg' => 3,
+        'access arguments' => array('administer content types'),
+      ),
+    );
+  }
   return $return;
 }
 
Index: modules/simpletest/tests/field_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.module,v
retrieving revision 1.9
diff -u -r1.9 field_test.module
--- modules/simpletest/tests/field_test.module	27 May 2009 18:34:00 -0000	1.9
+++ modules/simpletest/tests/field_test.module	19 Jun 2009 01:07:26 -0000
@@ -26,12 +26,12 @@
  */
 function field_test_menu() {
   $items = array();
-  $info = field_test_fieldable_info();
+  $bundles = field_info_bundles('test_entity');
 
-  foreach (array_keys($info['test_entity']['bundles']) as $bundle) {
-    $bundle_url_str = str_replace('_', '-', $bundle);
+  foreach ($bundles as $bundle_name => $bundle_info) {
+    $bundle_url_str = str_replace('_', '-', $bundle_name);
     $items['test-entity/add/' . $bundle_url_str] = array(
-      'title' => "Add $bundle test_entity",
+      'title' => t('Add %bundle test_entity', array('%bundle' => $bundle_info['label'])),
       'page callback' => 'field_test_entity_add',
       'page arguments' => array(2),
       'access arguments' => array('administer field_test content'),
@@ -61,7 +61,7 @@
  * Define a test fieldable entity.
  */
 function field_test_fieldable_info() {
-  $bundles = variable_get('field_test_bundles', array('test_bundle' => 'Test Bundle'));
+  $bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
   return array(
     'test_entity' => array(
       'name' => t('Test Entity'),
@@ -86,18 +86,18 @@
 /**
  * Create a new bundle for test_entity objects.
  *
- * @param $bundle
+ * @param $bundle_name
  *   The machine-readable name of the bundle.
  * @param $text
  *   The human-readable name of the bundle. If none is provided, the machine
  *   name will be used.
  */
-function field_test_create_bundle($bundle, $text = NULL) {
-  $bundles = variable_get('field_test_bundles', array('test_bundle' => 'Test Bundle'));
-  $bundles += array($bundle => $text ? $text : $bundle);
+function field_test_create_bundle($bundle_name, $text = NULL) {
+  $bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
+  $bundles += array($bundle_name => array('label' => $text ? $text : $bundle_name));
   variable_set('field_test_bundles', $bundles);
 
-  field_attach_create_bundle($bundle);
+  field_attach_create_bundle($bundle_name);
 }
 
 /**
@@ -109,7 +109,7 @@
  *   The new machine-readable name of the bundle.
  */
 function field_test_rename_bundle($bundle_old, $bundle_new) {
-  $bundles = variable_get('field_test_bundles', array('test_bundle' => 'Test Bundle'));
+  $bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
   $bundles[$bundle_new] = $bundles[$bundle_old];
   unset($bundles[$bundle_old]);
   variable_set('field_test_bundles', $bundles);
@@ -120,15 +120,15 @@
 /**
  * Delete a bundle for test_entity objects.
  *
- * @param $bundle
+ * @param $bundle_name
  *   The machine-readable name of the bundle to delete.
  */
-function field_test_delete_bundle($bundle) {
-  $bundles = variable_get('field_test_bundles', array('test_bundle' => 'Test Bundle'));
-  unset($bundles[$bundle]);
+function field_test_delete_bundle($bundle_name) {
+  $bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
+  unset($bundles[$bundle_name]);
   variable_set('field_test_bundles', $bundles);
 
-  field_attach_delete_bundle($bundle);
+  field_attach_delete_bundle($bundle_name);
 }
 
 /**
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1001
diff -u -r1.1001 user.module
--- modules/user/user.module	13 Jun 2009 20:40:09 -0000	1.1001
+++ modules/user/user.module	19 Jun 2009 01:07:28 -0000
@@ -91,6 +91,15 @@
     'user' => array(
       'name' => t('User'),
       'id key' => 'uid',
+      'bundles' => array(
+        'user' => array(
+          'label' => t('User'),
+          'admin' => array(
+            'path' => 'admin/settings/user',
+            'access arguments' => array('administer users'),
+          ),
+        ),
+      ),
     ),
   );
   return $return;
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.478
diff -u -r1.478 taxonomy.module
--- modules/taxonomy/taxonomy.module	12 Jun 2009 13:59:56 -0000	1.478
+++ modules/taxonomy/taxonomy.module	19 Jun 2009 01:07:26 -0000
@@ -27,9 +27,21 @@
       'name' => t('Taxonomy term'),
       'id key' => 'tid',
       'bundle key' => 'vocabulary_machine_name',
-      'bundles' => taxonomy_vocabulary_get_names(),
+      'bundles' => array(),
+      'bundle helper' => 'taxonomy_bundle_name_from_menu_helper',
     ),
   );
+  foreach (taxonomy_get_vocabularies() as $vocabulary) {
+    $return['taxonomy_term']['bundles'][$vocabulary->machine_name] = array(
+      'label' => $vocabulary->name,
+      'admin' => array(
+        'path' => 'admin/content/taxonomy/%taxonomy_vocabulary',
+        'real path' => 'admin/content/taxonomy/' . $vocabulary->vid,
+        'bundle argument' => 3,
+        'access arguments' => array('administer taxonomy'),
+      ),
+    );
+  }
   return $return;
 }
 
