The code of interest in my module is:
mymodule_menu($maycache)
{
// skipped
$items[] = array(
'path'=>'admin/build/mainisuct/links',
'title'=>t('Edit mainisuct page'),
'callback'=>'mainisuct_edit_links',
'type'=>MENU_NORMAL_ITEM,
'access' => user_access('edit mainisuct page')
// skipped
}
I change path to 'admin/build/mainisuct' and edit callback function a little bit. Save changes. Now in my browser I click this menu item and receive 'Page not found' under the new path. All usual mantras (delete from cache;, clear browser cache and restart it, restart apache2) don't help.
Just for fun I tried to go by the old path: 'admin/build/mainisuct/links' and got correct page with all recent changes in callback in place!
Again just for fun I switch to another locale. Menu item works just fine! It displays correct page under correct path!
It is easy to guess, that my default locale somehow 'knows' about old path and the name of callback function - all testing before the change mentioned was carried out in default locale.
I believe that it takes some time to Drupal to get used to the changes in module code and in a day or so everything will be ok.
But is it possible to help Drupal?
PS. Localizer module is used!
Comments
menu cache?
but missing from your mantra is "clear menu cache". Perhaps switching locale forced a menu cache flush/rebuild? The easiest way to clear your menu cache is to just visit admin/build/menu
Problem is solved
Dear AjK,
Thank you. Your mantra helps!
Is this supposed to work in
Is this supposed to work in Drupal 6 too or do I need to use another trick to clear menu cache?
It should work in D6
It should work in D6 too..but I suggest you just get the devel module, it lets you rebuild the menu right from a block.