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.
Notice: Undefined index: parent_mlid in menu_block_get_config() (line 309 of menu_block/menu_block.module.
Notice: Undefined index: parent_mlid in menu_tree_block_data() (line 348 of menu_block/menu_block.module.
Notice: Undefined index: parent_mlid in menu_tree_block_data() (line 379 of menu_block/menu_block.module.
Notice: Undefined index: parent_mlid in menu_tree_block_data() (line 401 of menu_block/menu_block.module.
I'm seeing these messages on every page load in the logs. Nothing seems to be broken. Would this be a case for an isset()?
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff.txt | 684 bytes | dsnopek |
#12 | menu_block-2642556-11.patch | 2.84 KB | dsnopek |
Comments
Comment #2
sourabh.singhal CreditAttribution: sourabh.singhal as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedComment #3
sourabh.singhal CreditAttribution: sourabh.singhal as a volunteer and at Faichi Solutions Pvt Ltd for Faichi Solutions Pvt Ltd commentedHi,
I have attached the patch file which fixed the bug. Please review.
Thanks
Sourdrup
Comment #4
dbazuin CreditAttribution: dbazuin at LimoenGroen commentedAfter applying the patch from comment 3 the Undefined index in line 379 and 401 where still there.
So I add two more fixes.
Comment #6
dbazuin CreditAttribution: dbazuin at LimoenGroen commentedI found one more function that sometimes gives a Undefined index so here is a new patch.
The function is template_preprocess_menu_block_wrapper()
Comment #7
genjohnson CreditAttribution: genjohnson at The University of Iowa commentedThe patch in #6 works for me, I've just re-rolled it to apply from the root of the menu_block module instead of the Drupal root.
Comment #8
genjohnson CreditAttribution: genjohnson at The University of Iowa commentedChanging status to "needs review" to trigger tests.
Comment #10
cboyden CreditAttribution: cboyden at UC Berkeley Web Platform Services commentedWhile testing this I saw menu_block errors in the dblog:
Comment #11
dsnopek@cboyden I haven't tested this, but I suspect your problem would be fixed by switching from
isset()
to!empty()
. A patch is attached that swaps those.Comment #12
dsnopekIt looks like an instance of
$config['expanded']
got converted toisset($config['expanded'])
when it shouldn't have been (since this issue is just about$config['parent_mlid']