=== modified file 'includes/menu.inc' --- includes/menu.inc 2010-10-04 18:17:17 +0000 +++ includes/menu.inc 2010-10-05 06:38:25 +0000 @@ -2334,7 +2334,9 @@ function menu_link_get_preferred($path = $query->fields('ml'); // Weight must be taken from {menu_links}, not {menu_router}. $query->fields('m', array_diff(drupal_schema_fields_sql('menu_router'), array('weight'))); - $query->condition('ml.menu_name', $menu_names, 'IN'); + if (!empty($menu_names)) { + $query->condition('ml.menu_name', $menu_names, 'IN'); + } $query->condition('ml.link_path', $path_candidates, 'IN'); // Sort candidates by link path and menu name.