开发者

Drupal Access to Admin panel Denied

Inserted new menu item in hook_menu. But the menu item is 开发者_C百科not reflected. So in module i added the statement as

function {module_name}_menu_alter(&$items) {
    $items['archives/faculty_article'] = array(
           'access callback'=>'archives_list_faculty_article',
         'access arguments'=>array(1),
        );
    $items['archives/faculty_article']['access callback'] = 'user_access';
}

Problem raised 1. Not able to access admin panel 2. user warning: Table 'nodewords_custom' doesn't exist query: SELECT * FROM nodewords_custom ORDER BY weight ASC

How can I correct the problem.


Have you flushed your menu cache after creating your new menu entry in the hook_menu()? It's mandatory if you want your new menu entry to be evaluated.

About your code snippet in the hook_menu_alter(), you are not altering properly the menu item, either your rewrite the full attributes of the item (title, page callback, access callback etc) either you just override one attribute (such as what you did for the access callback). If you want to override two attributes you have to do something like that:

$items['archives/faculty_article']['access callback'] = 'user_access';
$items['archives/faculty_article']['access arguments'] = array('view');

After implementing the hook_menu_alter() you also have to flush your caches.

That's for problem 1. For problem 2, it means that you didn't install nodewords correctly, try to disabling it, uninstalling it and then re-enabling it to try to fix the issue. It should recreate the table for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜