0

I have used drupal 7.38.I have created a custom hook_menu function(). My code is:

function jasmine_custom_menu(){
$items = array();
$items['review'] = array(
    'title' => 'Review Page',
    'page callback' => 'review_page',
    'access arguments' => TRUE,
    'type' => MENU_NORMAL_ITEM,
);  
return $items;
}
function review_page(){
  return 'hello workld';
}

after module enable error display like this: Warning: Invalid argument supplied for foreach() in menu_unserialize() (line 400 of D:\xampp\htdocs\jasmine\includes\menu.inc)

4

Your access arguments need to be an array. But I believe you are wanting to grant access to this page to everyone, so access arguments isn't the right key anyway; you want access callback. Try this:

$items['review'] = array(
    'title' => 'Review Page',
    'page callback' => 'review_page',
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM,
); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.