How do I create/submit a patch? (I know this info is somewhere...)
Anyway, the advanced_help_get_tree function in advanced_help.module did not account for the possibility of there being no help topice for a feature (in this case it was the "Number" type of the CCK, freshly installed.
So instead of
/**
* Build a tree of advanced help topics.
*/
function advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0) {
uasort($topic_ids, 'advanced_help_uasort');
$items = array();
foreach ($topic_ids as $info) {
list($module, $topic) = $info;
$item = advanced_help_l($topics[$module][$topic]['title'], "help/$module/$topic");
if (!empty($topics[$module][$topic]['children']) && ($max_depth == -1 || $depth < $max_depth)) {
$item .= theme('item_list', advanced_help_get_tree($topics, $topics[$module][$topic]['children'], $max_depth, $depth + 1));
}
$items[] = $item;
}
return $items;
}
I placed the array declaration as the first line and added a conditional to ensure that topic_ids were not empty before being used in usort or foreach, like this:
/**
* Build a tree of advanced help topics.
*/
function advanced_help_get_tree($topics, $topic_ids, $max_depth = -1, $depth = 0) {
$items = array();
if ( !empty($topic_ids) ) {
uasort($topic_ids, 'advanced_help_uasort');
foreach ($topic_ids as $info) {
list($module, $topic) = $info;
$item = advanced_help_l($topics[$module][$topic]['title'], "help/$module/$topic");
if (!empty($topics[$module][$topic]['children']) && ($max_depth == -1 || $depth < $max_depth)) {
$item .= theme('item_list', advanced_help_get_tree($topics, $topics[$module][$topic]['children'], $max_depth, $depth + 1));
}
$items[] = $item;
}
}
return $items;
}
Comments
Comment #1
yched commentedCheck latest -dev release, I do believe this has been fixed since then.
(Please reopen if not)
Comment #2
susannaschroeder commentedSorry - I got the version number wrong when I submitted the issue. I downloaded and installed 6.x-1.1 today, and found the problem there.
Issue re-opened.
Comment #3
yched commentedTry -dev, not 1.1 :-)
http://drupal.org/node/248490
Comment #4
merlinofchaos commentedNote that the core issue still exists, but can easily be fixed by adding 'hide' => TRUE in the settings portion of the .ini file.