【发布时间】:2009-08-25 20:15:54
【问题描述】:
出于某种原因,“创建内容”菜单项正在为 Anon 显示,即使该树或该路径中没有任何内容。 (Anon 只能创建特定类型的内容,但已移至其自己的顶级导航项。)
为了解决这个问题,我使用了 hook_menu_alter():
/**
* Remove "create content" from the menu if the user is anon
*/
function odp_menu_alter(&$items){
global $user;
if ($user->uid == 0) {
unset($items['node/add']);
}
}
出于某种原因,这也影响了超级用户帐户。我用该代码禁用了模块。现在 Create Content 链接又回来了,但它导致了这个错误:
Fatal error: Unsupported operand types in modules\system\system.module on line 626
创建内容下方的所有子树链接仍然有效。
我已刷新所有缓存。发生了什么?
【问题讨论】:
标签: caching menu drupal-6 hook