Closed (works as designed)
Project:
Drupal core
Version:
6.2
Component:
forum.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 May 2008 at 04:10 UTC
Updated:
28 Aug 2011 at 08:44 UTC
Code:
<?php
function mod_has_access() {
// Return true regardless for testing
return TRUE;
}
function mod_menu_alter(&$items) {
$items["forum/members"]['access callback'] = 'mod_has_access';
}
?>
Errors:
On the path /forum/members:
Fatal error: require_once() [function.require]: Failed opening required '/forum.pages.inc' (include_path='.;C:\php\pear') in C:\http_global\drupal\drupal-6.2\includes\menu.inc on line 344
On any other page after:
warning: require_once(/forum.pages.inc) [function.require-once]: failed to open stream: No such file or directory in C:\http_global\drupal\drupal-6.2\includes\menu.inc on line 344.
Comments
Comment #1
steven jones commentedThere isn't a 'forum/members' callback in Drupal core, so I assume that this callback is provided by a contrib module. Please provide more info.
Comment #2
larowlanYou are adding a new menu item - there is no such forum/members path.
As you are not giving the path a page callback, drupal is using the next parent in the menu - /forum - this calls the file forum.pages.inc but Drupal is looking for this file in your module folder (because your module is defining the menu item). Obviously the file is not there.
Please amend your implementation of hook_menu_alter to override an existing menu item (path) instead of adding a new one. Even though your site has forum/members - the members argument is most likely a dynamic parameter used by the callback at /forum.