By jaypan on
I have created a new module. In the module, I called hook_menu() like this:
function questionnaire_menu()
{
$items = array();
$items['questionnaire'] = array
(
'title' => t('Questionnaire'),
'description' => t('Description goes here'),
'page_callback' => 'questionnaire_get_form',
'type' => MENU_CALLBACK,
);
return $items;
}However, when I access the page after installation, I get 'You are not authorized to access this page.', even though I am user 0 and should be able to see all pages. Does anybody know how to fix this?
Comments
I should add that I have
I should add that I have also tried this:
And I get the same error.
Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
Sorry, I made a mistake in
Sorry, I made a mistake in the title of the thread. It should be 'user 1'. I am logged in as the master user, and am getting the error message.
Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
I assume you are using
I assume you are using D6.
Yes IIRC if you specify neither access callback nor arguments then access will always be denied. It is only in function user_access() that user ID 1 gets allowed through. http://api.drupal.org/api/function/user_access/6 http://drupal.org/node/109584#comment-862027
Having modified the menu structure defined by your module you then need to clear the menu cache for your changes to take effect ...
You prob
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Thank you GPK. You are
Thank you GPK. You are correct, I am using 6.x. I forgot to check that off when creating the thread.
I tried clearing the cache, but still got the same error. So I actually recreated the module under another name to see if it was just a caching problem, but I still got the same error.
The code I am using now is this:
Any ideas? Thanks again for your assistance.
Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
I got it to work somehow. I
I got it to work somehow. I don't know what was wrong, but I just wiped it clean and started from scratch, and it works this time.
Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
Glad it's working now.
Glad it's working now. :)
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
That code has an invalid key
Hi, in your code you named a key as' page_callback' where in reality is 'page callback', without the underscore.