Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
i get a notice
Notice: Trying to access array offset on value of type bool in menu_tree_output() (line 1070 of /code/includes/menu.inc).
whenever i visit a non-active link, Page not found, 404 page on my site, but also *sometimes* on active pages as well
Comments
Comment #2
mfbI'm upping the priority since this was actually a "major" issue for us - CI pipeline failed.
Comment #3
mfbComment #4
joelpittetComment #5
magicmyth CreditAttribution: magicmyth as a volunteer commentedI can confirm the issue and it is related to the fact the
menu_tree_output()
callsmenu_get_item()
but does not take into account that the later can sometimes return bool FALSE. Seems issue #3085088: menu_get_item() might return FALSE; calling code should take account of this was supposed to be the fix to resolve this issue but menu_tree_output() was missed.The patch is working fine for me and in my opinion no regressions would occur because past behaviour would have caused that block's condition to fail so the contained code would not be executed anyway and thus as expected that CSS class would not be added.
IMHO the risk of the patch is extremely low as if my statement above proved wrong the worse that would happen is that the `active` CSS class would be missing from the odd link so setting as RTBC.
Comment #6
mcdruidLGTM, thanks!
Comment #7
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commented+1
Comment #9
mcdruidThank you everyone!
Comment #10
idebr CreditAttribution: idebr at iO commentedThis issue was included in Drupal 7.76