I cannot edit any menu when the Menu Access Module is enabled from 'Admin>Content Management>Menus>(menu)'. I get the following error. Both files do exist (menu.admin.inc and menu_access).
As soon as I disable Menu Access, I can edit the menu again. All other tabs function normally.

I have a multisite configuration, and the same happens in any other site.

Fatal error: require_once() [function.require]: Failed opening required 'sites/all/modules/menu_access/./../../modules/menu/menu.admin.inc' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/includes/menu.inc on line 346

CommentFileSizeAuthor
#10 menu_access_hook_menu.patch4.32 KBfuerst

Comments

emptyvoid’s picture

Issue identified, system not validating the a path to the root of the Drupal installation.

emptyvoid’s picture

Assigned: Unassigned » emptyvoid

Please provide the following information

Operating System:
Operating System Version:
Database Server:
Database Server Version:
Http Server:
Http Server Version:
PHP Version:

Also please provide a link path to where the error occurred: (it doesn't matter that I can't access your site it helps me identify where)

emptyvoid’s picture

The nature of the error is the script can not find the root of the Drupal installation to correctly include one or more of the core include files.

The short-term HACK is to define the directory path from the module to the root of the Drupal installation. I will provide where to edit the file until I can find a multi-operating system/php solution.

If you are reading this and have a similar problem please post your errors and or fixes
!!!!! ONLY APPLY THIS CHANGE IF YOU ARE EXPERIENCE ERRORS !!!!!

You will need to change two files.

file: menu_access.module
line 86: 'file' => menu_access_path_to_root(getcwd()) . drupal_get_path('module', 'menu') .'/menu.admin.inc',
change to: 'file' => '../../../../'. drupal_get_path('module', 'menu') .'/menu.admin.inc',

line 97: 'file' => menu_access_path_to_root(getcwd()) . drupal_get_path('module', 'menu') .'/menu.admin.inc',
change to: 'file' => '../../../../'. drupal_get_path('module', 'menu') .'/menu.admin.inc',

line 107: 'file' => menu_access_path_to_root(getcwd()) . drupal_get_path('module', 'menu') .'/menu.admin.inc',
change to: 'file' => '../../../../'. drupal_get_path('module', 'menu') .'/menu.admin.inc',

file: menu_item_access.module
line 89: 'file' => menu_item_access_path_to_root(getcwd()) . drupal_get_path('module', 'menu') .'/menu.admin.inc',
change to: file' => '../../../../'. drupal_get_path('module', 'menu') .'/menu.admin.inc',

In order to fix the problem once you have made the change you must rebuilt the menu cache. This can be accomplished with the link of the link if you have the devel module installed otherwise I have read if you just go to "admin/build/modules" it will force Drupal to rebuild the menu cache.

in the example changes I may have provided too many '../../../../', if the error continues try using just three directory up statements "../../../"

Thanks,

emptyvoid’s picture

Version: 6.x-1.0 » 6.x-1.1

Finally,
I have successfully recreated the bug listed here and I will commit a fix to head. Please down and test the release, if all goes well I will release a security fix.

emptyvoid’s picture

Version: 6.x-1.1 » 6.x-1.3
Trunkhorn’s picture

I just had this same error with today's 6.x-1.5 release.

Fatal error: require_once() [function.require]: Failed opening required 'sites/all/modules/menu_access/../../../modules/menu/menu.admin.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/secretwebsite.com/includes/menu.inc on line 346

This happens on the Administer › Site building › Menus page when clicking either the "Add Menu" or "Settings" tabs when menu access is enabled.

I am logged in as the root user of my drupal installation. As you can probably tell from my error link, I am on a development server. Here are the specs:

MySQL database 5.0.51a
PHP 5.2.4-2ubuntu5.6
PHP memory limit 256M
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Web server Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.6 with Suhosin-Patch

emptyvoid’s picture

Version: 6.x-1.3 » 6.x-1.5

Hello, is this a fresh install or an upgrade from 1.4?

Trunkhorn’s picture

Fresh install, first time trying it.

GaneshDevdas’s picture

Hi.

The very same issue, as well fresh installation of 1.5

'../../../' in lines 86, 97 and 107 solves issue.

Distro: Debian // PHP5 5.2.9.dfsg.1-1 // PgSQL 8.3.7-1 // Apache 2.2.11-3 as well Suhosin Patch

fuerst’s picture

Status: Active » Needs review
StatusFileSize
new4.32 KB

Same problem as in node_access issue #414764: Fatal error: require_once(). Attached is the patch for menu_access.module and menu_item_access.module.

drcheers’s picture

I get this after I do that:

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'menu_edit_item' was given in /home/poorman1/public_html/war/includes/form.inc on line 366.

Any help would be appreciated. I am a HTML programmer not a PHP and I have no idea what that means.

emptyvoid’s picture

Great patch I also have fixes for the array error and detection of un-published nodes..

I will roll the patch into the fixes I plan to release this weekend. Sadly I have been very, very, very busy.

emptyvoid’s picture

Status: Needs review » Fixed

Issue fixed with the patch provided. Please reopen this issue should the issue still exist.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.