Hi,
I'm new to this forum, so I hope my post will be in the right format...
I inherited a drupal site and setup a local installation and a development server. I have a module that implements hook_menu and creates some menus items. After I moved the site to the development server (copied all files and imported the sql) I managed to get the site to work correctly.
But if I try to change something in the menu (like admin/build/menu/item/756/edit) and save it, i get the error message 'The path 'calculator/day' is either invalid or you do not have access to it.' Strangely enough, if i click on the menuitem on the site, the path to 'calculator/day' opens without a problem. I do not get this error message on my local machine.
So, the menu_hook implementation looks something like this:
function mymodule_menu() {
$items = array();
$items['calculator/day'] = array(
'title' => 'Daycalculator',
'description' => 'Daycalculator.',
'page callback' => 'mymodule_calculator',
'page arguments' => array('day'),
'access arguments' => array('access content'),
);
return $items;
}
If I try to enter the path 'calculator/day' in the menu-edit screen and save it, i get the above error message.
What could be causing this, in which direction should i search? I already spent two days on this issue and i'm out of ideas... So any help/hint would be greatly appreciated. If you need more info about the setup, let me know!
Thanks!
Comments
Clear cache
might help with menu stuff. Its under the performance section of site configuration. You could also try entering the complete path, http://www.blah.com/calculator/day which is a pain when you move sites around but might help.
www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy
That didnt work either
Hi Scrypter,
thanks for your reply... I made a habit of clearing the cache all the time (using devel it's not too bad), so that's not the issue.
The weird thing is, that if I use an absolute path (not an ideal solution as I have 3 stages, but i could live with it), i do not get an error message, but the changes to the menu are not saved at all (without any message).
For now I make menu changes locally and then transport them to the staging server by exporting and importing the 3 menu tables. Not nice at all, but at least i can work again.
Any more suggestions are welcome!
Thanks
dready
I'm having the same problem
Hi! I'm having the same problem and I'm actually going crazy. I don't know what to do! I've been working on my site since February 2011 and I didn't have this issue until 2 weeks ago. I try to add a new item to the "primary links" and when I want to save, I get the message "The path 'Apple' is either invalid or you do not have access to it". What's going on? Why do I have no access to it if I'm the administrator? Please HELP! I'm really desperate!
Thanks a lot!
Same Problem...fixed
I was having this problem as well, and I was able to resolve it by removing the preceding '/' from the beginning of my path.
It may not resolve everyone's issue, but it resolved mine :)
Make content before linking to it
I was getting this error simply because I was trying to use a URL for a page before I actually created that URL Alias on that page. Once the alias was made, then it let me create the link.