By splacette on
Hi,
I'm having a strange issue with upgrading a custom module from 5.2 to 6.0 beta 1. When I try to access one of the pages in the menu declaration (localhost/tinyurl), I get a blank page that says only "2", and watchdog reports access denied for that page. I already set permissions to all users, and even tried accessing the page as uid=1, but I still get the "2" response and "access denied" log.
By the way, here is my hook_menu implementation:
function tinyurl_menu() {
$items = array();
$items['tinyurl'] = array(
'title' => t('Create a new tinyURL'),
'page callback' => 'drupal_get_form',
'page arguments' => array ('tinyurl_add_form'),
'access callback' => 'user_access',
'access arguments' => array('access tinyurl'),
'type' => MENU_NORMAL_ITEM
);
//... more menu items go here...
return $items;
}Has anybody seen behavior like this before? Or does somebody see an error in my menu declaration syntax? Any help would be greatly appreciated!
Thanks,
Sam
Comments
More Information...
I'll try to provide some more information here. First of all, this is a Drupal 6.0 Beta 1 installation running on my dev machine, which is running Ubuntu 7.04, Apache, MySQL, and PHP5.
I've already tried Google, the Drupal forums archive, and reading (and re-reading) the Drupal 6.x menu system documentation. I haven't been able to find anything that could explain the type of behavior I'm seeing here.
The first thing I tried was setting the permissions to the most lax possible (i.e., every possible user, even anonymous users, have 'access tinyurl' permission.) Secondly, I tried logging in as UID=1, which is supposed to have access to everything, but I still get a watchdog 'access denied' error for the Drupal admin.
Then I tried inserting a debugging statement into user.module at the user_access function:
drupal_set_message ($account->name ." getting permissions for ". $string);Now, when I access most pages I get a long string of permissions that are being checked... but when I navigate to localhost/tinyurl, these are the only statements that are output:
Very interesting... It never seems to check for 'access tinyurl' permission like it should. Unfortunately, this information doesn't help me very much.
I'd be really interested in hearing other peoples' ideas. Does anyone have a suggestion of a good debugging method to get under the covers and see where the permission checking sequence is going wrong? Or maybe I'm making a really obvious mistake. Any help would be much appreciated.
Thanks,
Sam Placette
More confused than ever
I wanted to get some more debug information on this problem, so I searched the Drupal modules for development modules that might help. I installed the Devel and Visualize Backtrace modules, then my module Just Worked!
I'm now more confused than ever as to why I was getting the problem in the first place, but I guess my problem has been solved.
Peace,
Sam
I am experiencing the same
I am experiencing the same problem, did you find out what was wrong?
Cache
In hindsight it seems like this was a cache issue. After enough time went by, (I assume) the menu cache updated and the page was accessible. You can try clearing out the menu cache and/or page cache using your mysql client and see if that works.
Good luck,
Sam
Have you had the same problem
Have you had the same problem with any of the more recent D6 beta releases?
D6 beta version
We're on Drupal 6 Beta 3 now and as far as I know this module hasn't given us any problems since the initial migration from 5.2 to 6.0 Beta 1.