Fix for MENU_DEFAULT_LOCAL_TASK weight

  1. /**
  2.  * Implementation of hook_menu_alter().
  3.  */
  4. function XXXXX_menu_alter(&$items) {
  5.   // Set the data from the main item to the account tab.
  6.   $items['user/%user_category/edit/account'] = $items['user/%user_category/edit'];
  7.   $items['user/%user_category/edit/account']['tab_parent'] = 'user/%/edit';
  8.   $items['user/%user_category/edit/account']['type'] = MENU_LOCAL_TASK;
  9.   $items['user/%user_category/edit/account']['title'] = 'Account';
  10.  
  11.   // Make NAW the default local task.
  12.   $items['user/%user_category/edit/NAW']['type'] = MENU_DEFAULT_LOCAL_TASK;
  13.   $items['user/%user_category/edit/NAW']['weight'] = -10;
  14.   $items['user/%user_category/edit']['access callback'] = $items['user/%user_category/edit/NAW']['access callback'];
  15.   $items['user/%user_category/edit']['access arguments'] = $items['user/%user_category/edit/NAW']['access arguments'];
  16.   $items['user/%user_category/edit']['page arguments'] = array(1, 'NAW'); // Hardcoded 'NAW' because arg(3) will not be set anymore.
  17. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.