diff -u b/profile2.module b/profile2.module --- b/profile2.module +++ b/profile2.module @@ -101,7 +101,9 @@ 'weight' => -10, ); $items['user/%user/edit/%profile2_menu'] = array( + // @see http://drupal.org/node/1863502 'load arguments' => array(1, 'edit'), + 'load arguments' => array('%map', 'edit'), 'title' => 'Edit profile', 'title callback' => 'entity_page_label', 'title arguments' => array(3), @@ -112,7 +114,9 @@ 'type' => MENU_LOCAL_TASK, ); $items['user/%user/edit/%profile2_menu/delete'] = array( + // @see http://drupal.org/node/1863502 'load arguments' => array(1, 'delete'), + 'load arguments' => array('%map', 'delete'), 'title' => 'Delete profile', 'access callback' => 'profile2_access', 'access arguments' => array(3, 'delete'), @@ -138,7 +142,13 @@ * @return Drupal\profile2\Plugin\Core\Entity\Profile|false * The profile of type $type_id of the user account, or FALSE. */ -function profile2_menu_load($type_id, User $account, $op = '') { +// @see http://drupal.org/node/1863502 +//function profile2_menu_load($type_id, User $account, $op = '') { +function profile2_menu_load($type_id, $map, $op = '') { + if (!isset($map[1]) || !($map[1] instanceof User)) { + return FALSE; + } + $account = $map[1]; if ($type_id === '' || !$account->id()) { return FALSE; }