Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment | File | Size | Author |
---|---|---|---|
#16 | d7-on_the_access_denied-696092-16.patch | 729 bytes | pranit84 |
#14 | d7-on_the_access_denied-696092-12.patch | 2.89 KB | annya |
#8 | d8-extended_menu_on_access_denied-696092-7.patch | 2.36 KB | marthinal |
#4 | extended_menu_on_access_denied-696092.patch | 1.25 KB | estebanvalerio.h |
access_denied_menu.png | 324.9 KB | Danny_Joris |
Comments
Comment #1
LonitaD CreditAttribution: LonitaD commentedI 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
Comment #2
dddave CreditAttribution: dddave commentedRecreated. Kicking to D8.
Comment #3
Shyamala CreditAttribution: Shyamala commentedPreliminary 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...
Comment #4
estebanvalerio.h CreditAttribution: estebanvalerio.h commentedThis 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.
Comment #5
Bartezz CreditAttribution: Bartezz commentedChanges 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
Comment #6
tim.plunkettThis is not major, nor RTBC. It need automated tests, and the patch has to conform to Drupal's coding standard.
Comment #7
marthinal CreditAttribution: marthinal commentedPatch + Test.
Comment #8
marthinal CreditAttribution: marthinal commentedPatch + test changed to needs review.
Comment #12
annya CreditAttribution: annya commentedFix for Drupal 7.
Comment #14
annya CreditAttribution: annya commentedFix wrong test selection.
Comment #15
annya CreditAttribution: annya commentedComment #16
pranit84Patch for the expended menu on access denied pages on Drupal 7.