I tried to implement hook_menu in drupal.
function menufun_menu() {
$items['menufun'] = array(
'title' => 'Menu Fun',
'title callback' => 'menufun_title',
'page callback' => 'menufun_greeting',
'file' => 'menufun_greeting.inc',
'page arguments' => array('aaa', 'bbb', 'ccc', 'ddd'),
'access callback' => 'user_access',
'access arguments' => array('receive greeting'),
'type' => MENU_NORMAL_ITEM,
'weight' => -1,
);
$items['menufun/farewell'] = array(
'title' => 'Farewell',
'page callback' => 'menufun_farewell',
'file' => 'menufun_greeting.inc',
'access callback' => 'user_access',
'access agruments' => array('receive greeting'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
However, the code above will case these 2 errors:
Notice: Undefined offset: 0 in _menu_check_access() (line 619 of /Applications/XAMPP/xamppfiles/htdocs/drupal/includes/menu.inc).
Notice: Undefined offset: 1 in _menu_check_access() (line 619 of /Applications/XAMPP/xamppfiles/htdocs/drupal/includes/menu.inc).
The above 2 errors will not show up if i change
'access callback' => 'user_access',
to
'access callback' => TRUE,
But I already login as administrator, and I give the access permission to all users, and I tried to reload the module, tried to reinstall drupal so that make the database clean, but I still got the same errors, any advices?