diff -u b/includes/entity.ui.inc b/includes/entity.ui.inc --- b/includes/entity.ui.inc +++ b/includes/entity.ui.inc @@ -505,6 +505,7 @@ */ public function hook_menu() { $items = parent::hook_menu(); + $path_ends = array(); // Extend the 'add' path. $items[$this->path . '/add'] = array( @@ -516,18 +517,23 @@ 'access arguments' => array('create', $this->entityType), 'type' => MENU_LOCAL_ACTION, ); - $items[$this->path . '/add/%'] = array( - 'title callback' => 'entity_ui_get_action_title', - 'title arguments' => array('add', $this->entityType, $this->id_count + 1), - 'page callback' => 'entity_ui_get_bundle_add_form', - 'page arguments' => array($this->entityType, $this->id_count + 1), - 'access callback' => 'entity_access', - 'access arguments' => array('create', $this->entityType), - ); + $path_ends[] = '/add'; + + foreach ($this->entityInfo['bundles'] as $bundle_name => $bundle_info) { + $items[$this->path . '/add/' . $bundle_name] = array( + 'title callback' => 'entity_ui_get_action_title', + 'title arguments' => array('add', $this->entityType, $this->id_count + 1), + 'page callback' => 'entity_ui_get_bundle_add_form', + 'page arguments' => array($this->entityType, $this->id_count + 1), + 'access callback' => 'entity_access', + 'access arguments' => array('create', $this->entityType), + ); + $path_ends[] = '/add/' . $bundle_name; + } if (!empty($this->entityInfo['admin ui']['file'])) { // Add in the include file for the entity form. - foreach (array('/add', '/add/%') as $path_end) { + foreach ($path_ends as $path_end) { $items[$this->path . $path_end]['file'] = $this->entityInfo['admin ui']['file']; $items[$this->path . $path_end]['file path'] = isset($this->entityInfo['admin ui']['file path']) ? $this->entityInfo['admin ui']['file path'] : drupal_get_path('module', $this->entityInfo['module']); }