backdrop-contrib / bigmenu

GNU General Public License v2.0
2 stars 1 forks source link

Notice: Undefined variable: mlid in _bigmenu_overview_tree_form() #6

Open bugfolder opened 1 year ago

bugfolder commented 1 year ago

I'm getting lots of dblog errors of this sort:

Notice: Undefined variable: mlid in _bigmenu_overview_tree_form() (line 306 of /mysite/modules/contrib/bigmenu/bigmenu.admin.inc).

Looking at the code, the if chunk at the bottom contains references to variable $mlid, but that's only defined if up in line 240 the item exists and is not hidden:

    if ($item && $item['hidden'] >= 0) {
bugfolder commented 1 year ago

Filed PR is a brute-force fix by checking for the existence of $mlid before using. But I think this code needs further examination before merging it. I'm a little puzzled by that final if being outside the for loop (in _menu_overview_tree_form() it's inside the loop), and there's still some weird behaviors seen in the Management menu on my local installation.