Custom Entity Administration Pages I am trying to create a custom entity with user manageable bundles with very little luck.

I have been using a couple of other modules that do this very successfully like field collection and the latest version of the invite module.

Very simply, there is an event entity which has multiple types. The user should be able to create and manage these multiple types - similar to how users can create and manage multiple field collections.

My entity info is as follows:

function enf_entity_info() {
  $return = array(
    'enf_event' =&gt; array(
      'label' =&gt; t('ENF Event'),
      'entity class' =&gt; 'ENFEvent',  // defined - simple
      'controller class' =&gt; 'ENFEventController', // defined - simple
      'base table' =&gt; 'enf_event', // defined
      'fieldable' =&gt; TRUE,
      'entity keys' =&gt; array(
        'id' =&gt; 'event_id',
        'bundle' =&gt; 'event_type',
      ),
      'bundle keys' =&gt; array(
        'bundle' =&gt; 'event_type',
      ),
      'view modes' =&gt; array(      // I don't expect to need these
        'full' =&gt; array(
          'label' =&gt; t('Default'),
          'custom settings' =&gt; FALSE,
        ),
      ),
      'bundles' =&gt; array(),
      'label callback' =&gt; 'entity_class_label',
      'uri callback' =&gt; 'entity_class_uri',
      'module' =&gt; 'enf',
      'access callback' =&gt; 'enf_event_access',  // simply returns TRUE
      'metadata controller class' =&gt; 'EntityDefaultMetadataController',
    ),
  );

  $return['enf_event_type'] = array(
    'label' =&gt; t('ENF Event Type'),
    'entity class' =&gt; 'ENFEventType', // defined - simple
    'controller class' =&gt; 'ENFEventTypeController', // defined - simple
    'base table' =&gt; 'enf_event_type', // defined
    'fieldable' =&gt; FALSE,
    'bundle of' =&gt; 'enf_event',
    'exportable' =&gt; TRUE,
    'entity keys' =&gt; array(
      'id' =&gt; 'type_id',
      'name' =&gt; 'event_type',
      'label' =&gt; 'label',
    ),
    'module' =&gt; 'enf',
    // Enable the entity API's admin UI.
    'admin ui' =&gt; array(
      'path' =&gt; 'admin/structure/enf-event-types',
      'file' =&gt; 'includes/enf.admin.inc', // includes the form functions
      //'controller class' =&gt; 'ENFEventTypeUIController',
    ),
    'access callback' =&gt; 'enf_event_type_access',
  );
  return $return;
}


the bundles are then added in in the alter

/**
 * Implements hook_entity_info_alter().
 */
function enf_entity_info_alter(&amp;$entity_info) {
  foreach (enf_get_types() as $type =&gt; $info) {
    $entity_info['enf_event']['bundles'][$type] = array(
      'label' =&gt; $info-&gt;label,
      'admin' =&gt; array(
        'path' =&gt; 'admin/structure/enf-event-types/manage/%event_type',
        'real path' =&gt; 'admin/structure/enf-event-types/manage/' . $type,
        'bundle argument' =&gt; 5,
      ),
    );
  }
}


The admin page seems to work - however, there are manage fields and manage display menu options on the page itself. These go to a 

/admin/structure/enf-event-types/manage/%25event_type/fields


and
    /admin/structure/enf-event-types/manage/%25event_type/display

and there are notifications displayed and saving and such errors out.

It is possible to add types - the form is displayed and creates a new type on submit.

However, when clicking through the fields or display links, a 404 comes back

/admin/structure/enf-event-types/manage/test/fields
/admin/structure/enf-event-types/manage/test/display


It seems like it should really be very simple to do this but something is missing.

Any assistance greatly appreciated...
A little bit late, however, hope this will be of use.

When defining an admin path for each bundle, path provides the path that should be used in hook_menu for the Field UI´s pages. For resolving the '%event_type' placeholder in admin paths, you need to provide a loader function that, in your case, should be 'event_type_load' and it must return a single type object.

/**
 * Event type loader function.
 *
 * param $type string
 *  The name of the event type as it appears in the admin Path placeholder 
 *  of a bundle. By convention, all Drupal paths use dashes instead of underscores.
 * 
 * return $type stdClass object
 * 
 */
function event_type_load($type) {
        $types = enf_get_types();
        // We need to replace dashes that may appear in $type with underscores.
        // By convention, bundle names needs to use underscores, not dashes.
        $type = str_replace('-', '_', $type);
        return isset($types[$type]) ? $types[$type] : FALSE;
}


You may need to modify as well the line that reads,

'real path' =&gt; 'admin/structure/enf-event-types/manage/' . $type,


and replace it with the following one:

'real path' =&gt; 'admin/structure/enf-event-types/manage/' . str_replace('_', '-', $type),


NOTE: to be consistent with the name of the module that defines your custom entity, you may want to rename the admin path placeholder '%event_type' to be '%enf_event_type', and thus the loader function would be 'enf_event_type_load'.