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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

monsterreh2b created an issue. See original summary.

mfb’s picture

mfb’s picture

joelpittet’s picture

Issue tags: +PHP 7.4
magicmyth’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm the issue and it is related to the fact the menu_tree_output() calls menu_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.

mcdruid’s picture

Issue tags: +Pending Drupal 7 commit

LGTM, thanks!

Fabianx’s picture

+1

  • mcdruid committed ccf8162 on 7.x
    Issue #3155357 by mfb, monsterreh2b, joelpittet, magicmyth: menu tree...
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Pending Drupal 7 commit

Thank you everyone!

idebr’s picture

This issue was included in Drupal 7.76

Status: Fixed » Closed (fixed)

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