I am getting an offset error , Undefined offset: 4 in _menu_translate()
$items['admin/content/import-dashboard/new'] = array(
'title' => 'Import Dashboard',
'page callback' => 'drupal_get_form',
'page arguments' => array('import_dashboard_new_content',"article"),
'access arguments' => array('Import Dashboard Permission'),
'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
'expanded' => TRUE,
);
$items['admin/content/import-dashboard/new/%'] = array(
'title' => 'Import Dashboard',
'page callback' => 'drupal_get_form',
'page arguments' => array('import_dashboard_new_content',4),
'access arguments' => array('Import Dashboard Permission'),
'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
'expanded' => TRUE,
);
I simply want to default new to article, and also use wildcards to support other arguments.
I'm pretty flexible in my approach, so feel free to throw a few suggestions if it could be done better.
Can someone quickly suggest where I made my rookie mistake?
Indeed, changing to Menu Callback works when using the wildcard.
$items['admin/content/import-dashboard/new/%'] = array(
'title' => 'Import Dashboard',
'page callback' => 'drupal_get_form',
'page arguments' => array('import_dashboard_new_content',4),
'access arguments' => array('Import Dashboard Permission'),
'type' => MENU_CALLBACK,
'expanded' => TRUE,
);
Would still like to know why it fails when it a MENU_LOCAL_TASK or MENU_NORMAL_ITEM
MENU_CALLBACK
is because you're telling Drupal to ignore your arguments...I think. Maybe try taking a look at what the number 4 is doing in thepage arguments
. It might have something to do with the error.