Installation
------------
Unfortunately you need to patch the drupal file includes/menu.inc. Use the the patch
provided with the module. If you don't know how to patch, you can just insert the three
additional lines manually - but remove the leading plus.

Then copy the module's whole directory in your drupal modules directory and activate it.

I'm sorry, but I'm not sure what to do here. Was I suppose to put this:

+        if (module_exists('menu_per_role') && !is_null($access = menu_per_role_access($item->mid))) {
+          $_menu['items'][$item->mid]['access'] = isset($_menu['items'][$item->mid]['access']) ? $_menu['items'][$item->mid]['access'] && $access : $access;
+        }
         $_menu['items'][$item->mid]['title'] = $item->title;
         $_menu['items'][$item->mid]['description'] = $item->description;
         $_menu['items'][$item->mid]['pid'] = $item->pid;

minus the "+" at the end of menu.inc?

The language wasn't clear to me. Could you please be more specific. Thank you....

Comments

chayner’s picture

Assigned: Unassigned » chayner
Status: Active » Closed (fixed)

In the patch file, there is a line like: @@ -1129,6 +1129,9 @@

That indicates the line where the patch needs to be placed. In this case, it is line 1129 of menu.inc. On or around that line, you will see code like:

       // If the administrator has changed the item, reflect the change.
       if ($item->type & MENU_MODIFIED_BY_ADMIN) {
         $_menu['items'][$item->mid]['title'] = $item->title;
         $_menu['items'][$item->mid]['description'] = $item->description;
         $_menu['items'][$item->mid]['pid'] = $item->pid;

And insert the lines with the "+" signs in the appropriate place, like so:

       // If the administrator has changed the item, reflect the change.
       if ($item->type & MENU_MODIFIED_BY_ADMIN) {
        if (module_exists('menu_per_role') && !is_null($access = menu_per_role_access($item->mid))) {
          $_menu['items'][$item->mid]['access'] = isset($_menu['items'][$item->mid]['access']) ? $_menu['items'][$item->mid]['access'] && $access : $access;
        }
         $_menu['items'][$item->mid]['title'] = $item->title;
         $_menu['items'][$item->mid]['description'] = $item->description;
         $_menu['items'][$item->mid]['pid'] = $item->pid;

If you still have any questions, don't hesitate to ask!

infamousurge’s picture

Title: Help with includes/menu.inc patch » menu per role patch

thanks for the info, much appreciated!