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.
I got this error when upgrading to PHP 7.4:
Notice: Trying to access array offset on value of type bool in _menu_block_format_title() (line 178 of /var/www/html/sites/all/modules/contrib/menu_block/menu_block.admin.inc).
Comment | File | Size | Author |
---|---|---|---|
#2 | 3178543-menu-block-trying-to-access-array-offset-on-value-of-type-bool.patch | 577 bytes | samberry |
Comments
Comment #2
samberry CreditAttribution: samberry as a volunteer and at NDP commentedComment #3
samberry CreditAttribution: samberry as a volunteer and at NDP commentedComment #4
brad.bulger CreditAttribution: brad.bulger commentedWhat were you trying to do when you got this? I'm seeing a similar error in the module file on PHP 7.4, but I can't recreate this one. There's a similar case in menu_tree_block_data() that gets reported to watchdog as an error, which makes sense to me. If the parent mlid is not empty but does not load a value, that seems like a problem.
Comment #5
joelpittet@brad.bulger I assume you're issue was fixed by #3182751: PHP 7.4 Notice: Trying to access array offset on value of type bool in menu_block_tree_output() ?
Comment #6
brad.bulger CreditAttribution: brad.bulger commentedI hadn't seen that but yes that's the same change that I'd made to menu_block_tree_output(). This issue in _menu_block_format_title() seems different. I can't recreate it, but it looks like an actual error if that menu_link_load() call fails - like, that something is wrong with the menu or something. I'm just being nosy.
Comment #7
joelpittetI fixed the indent on this but I think it follows, if the menu link can't be loaded for some reason it will be hard pressed to get the title. Thanks @samberry
Comment #9
joelpittetComment #11
wylbur CreditAttribution: wylbur at Electric Citizen commentedAdding PHP 7.4 issue tag