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(&$entity_info) {
foreach (notification_types() as $type => $info) {
$entity_info['notification']['bundles'][$type] = array(
'label' => $info->label,
'admin' => array(
'path' => 'admin/structure/notification-types/manage/%notification_type',
'real path' => 'admin/structure/notification-types/manage/' . $type,
'bundle argument' => 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' => 'admin/structure/notification-types/manage/%',
all of a sudden it worked, the wrong tabs went away and the bundles were manageable. My question: Why?!