Hi all,

On the "access denied" page, menu's don't show the "expanded" classes. The expanded classes are key to properly style my sitemap cross-browser. And my sitemap is really important on a page like that.

Does anyone have an idea what causes this?

Cheers,
Danny

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LonitaD’s picture

I also discovered this happening on a site I am developing in 6.20. Not only are the expanded classes not applied, the menu does not load the nested menu items, which are critical in the case of the site navigation for this particular site. This happens for anonymous as well as logged in users. Issue #876138: Menus do not expand on access denied pages addresses this issue in 7.x.

Steps to recreate are the same in 6.x and 7.x:
* Edit a menu item that has children (admin/structure/menu/item/17/edit) and mark it as "Show as expanded".
* Visit user/register (when logged in) or another page to which one does not have access.
* Observe the menu in question

dddave’s picture

Version: 6.14 » 8.x-dev

Recreated. Kicking to D8.

Shyamala’s picture

Preliminary analysis of the issue:

The Menu's are built using the function menu_tree. This in turn calls the function menu_tree_page_data, where the $item['access'] obtained from function _menu_check_access is null for all menu's rendered in the access denied page.

Though the user has access to the menu, because he doesnot have access for the page menu callback, in the function menu_get_item the $router_item['access'] for all menu items in the Access Denied page are set as null.

Since the access is null the menu tree doesnot get built in function menu_tree_page_data.

The fix has to be in function _menu_check_access...

estebanvalerio.h’s picture

This is a simple solution.
We tested it publishing and unpublishing content and adding a link to a menu and analizing the behavior, it works for us but we are pretty sure that we are missing other test cases.
Now on an access denied page, if a menu link has the expanded property, we will see it expanded.
Work with Max Mendez, Alejandro Madrigal and others.

Bartezz’s picture

Priority: Normal » Major
Status: Active » Reviewed & tested by the community

Changes from patch in #4 solve this bug, manually applied in D7.

Better solution, use menu block module to show menu, can expand menu items this way without having to patch core!

Cheers

tim.plunkett’s picture

Priority: Major » Normal
Status: Reviewed & tested by the community » Needs work
Issue tags: -dlatino, -drupalcr +Needs tests

This is not major, nor RTBC. It need automated tests, and the patch has to conform to Drupal's coding standard.

marthinal’s picture

Patch + Test.

marthinal’s picture

Status: Needs work » Needs review
FileSize
2.36 KB

Patch + test changed to needs review.

Status: Needs review » Needs work

The last submitted patch, 8: d8-extended_menu_on_access_denied-696092-7.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

annya’s picture

Version: 8.1.x-dev » 7.x-dev
Issue summary: View changes
Status: Needs work » Needs review
FileSize
2.89 KB

Fix for Drupal 7.

Status: Needs review » Needs work

The last submitted patch, 12: d7-on_the_access_denied-696092-12.patch, failed testing.

annya’s picture

annya’s picture

Status: Needs work » Needs review
pranit84’s picture

Patch for the expended menu on access denied pages on Drupal 7.

Status: Needs review » Needs work

The last submitted patch, 16: d7-on_the_access_denied-696092-16.patch, failed testing. View results