Fix for Drupal 6 dhtml_menu module error Invalid argument supplied for foreach statement
Tue, 2011-07-05 15:00 | SergeChel
This log warning is not a rare issue for those who got Drupal dhtml_menu module installed. Usually it something like:
warning: Invalid argument supplied for foreach() **** in */sites/all/modules/dhtml_menu/dhtml_menu.module on line ***.
In my case it is line 175 with the code
foreach ($index[$item['mlid']]['parents'] as $mlid) {
I did a quick fix with this code, inserted before line 175
if (!is_array($index[$item['mlid']]['parents'])) { $index[$item['mlid']]['parents'] = array(); }