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()?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ponies created an issue. See original summary.

sourabh.singhal’s picture

Assigned: Unassigned » sourabh.singhal
sourabh.singhal’s picture

Hi,

I have attached the patch file which fixed the bug. Please review.

Thanks
Sourdrup

dbazuin’s picture

After applying the patch from comment 3 the Undefined index in line 379 and 401 where still there.
So I add two more fixes.

Status: Needs review » Needs work
dbazuin’s picture

I found one more function that sometimes gives a Undefined index so here is a new patch.
The function is template_preprocess_menu_block_wrapper()

genjohnson’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
2.84 KB

The 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.

genjohnson’s picture

Status: Reviewed & tested by the community » Needs review

Changing status to "needs review" to trigger tests.

cboyden’s picture

Status: Needs review » Needs work

While testing this I saw menu_block errors in the dblog:

Menu block 1 is set to use parent menu link 0 but the menu link was not loadable or does not exist.
dsnopek’s picture

Status: Needs work » Needs review
FileSize
2.84 KB

@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.

dsnopek’s picture