Notice: Undefined index: depth_relative in menu_tree_block_data() (line 360 of menu_block.module).

The 7.x-2.6 version added relative depth to menu block configuration which is great. However, if someone has existing sites with many menu blocks configured (at least using panels), $config['depth_relative'] will not exist in the configuration for any of them until each and every panel pane/block is re-saved. And all of them will throw errors.

That places quite a burden on folks attempting to upgrade large numbers of sites.

Could you wrap the new variable in isset? Example:


if (isset($config['depth_relative']) && $config['depth_relative']) {
}

Comments

osopolar’s picture

Patch fixes that as suggested above. If this is not an option there should be an update hook setting the missing variable. This could be difficult for panels.

osopolar’s picture

Status: Active » Needs review
danepowell’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #1 looks good and worked for me.

jastraat’s picture

@osopolar - could you add credit since I debugged the issue and suggested the fix?

osopolar’s picture

I am not a module maintainer. You may just create a new patch and add your credits.

geerlingguy’s picture

+1 - just noticed this new notice popping up everywhere :P

maxplus’s picture

Thanks,

#1 solved this issue for me

dman’s picture

+1
Patch applies well. Would be good to clean this up.

  • Dave Reid committed 8f80ce0 on 7.x-2.x authored by osopolar
    Issue #2499733 by osopolar, jastraat, joelpittet: Fixed PHP notices with...
dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Committed #1 to 7.x-1.x.

Status: Fixed » Closed (fixed)

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