Entity API fieldable entity path issue So, after studying several examples, I started writing my own module to implement a notification-like entity.

I wanted it to allow separate bundles and be fieldable. This example was a great guide to me.

I've spend several hours and almost brought the wall down with my head due to the following issue though.

My implementation of hook_entity_info_alter:

function mymodule_entity_info_alter(&amp;$entity_info) {
  foreach (notification_types() as $type =&gt; $info) {
    $entity_info['notification']['bundles'][$type] = array(
      'label' =&gt; $info-&gt;label,
      'admin' =&gt; array(
        'path' =&gt; 'admin/structure/notification-types/manage/%notification_type',
        'real path' =&gt; 'admin/structure/notification-types/manage/' . $type,
        'bundle argument' =&gt; 4,
      ),
    );
  }
}


to provide admin UI for my bundles, wouldn't work. It would provide "Manage Fields" and "Manage Display" tabs in my /admin/structure/notification-types list page with "broken" links such as /admin/structure/notification-types/manage/%25notification_type/fields.

Furthermore when I tried to manage fields of my bundles, I got a "page not found" error.

When I changed the 'path' array element to this:

'path' =&gt; 'admin/structure/notification-types/manage/%',


all of a sudden it worked, the wrong tabs went away and the bundles were manageable. My question: Why?!
GOT IT! After googling for a while I came accross this: http://drupal.org/node/224170

This clarifies that

"When a % symbol is used in a menu element (see example), the text that follows will be used to build the name of wildcard loader function.

In the example above, "%node" tells drupal to pass the value of the second element to the function node_load(). _load is always added by Drupal to construct the wildcard loader."

So as long as the notification_type_load() function wasn't implemented it lead to a bug :)