When no links are defined, there's a Drupal error that pops up, where a variable is expected to be present in a foreach() loop around line 434. An if statement would fix it quick.
$rows = array();
if ($form['alinks']['#value']) {
foreach($form['alinks']['#value'] as $id=>$alink) {
$row = array();
$row[] = array('data' => drupal_render($form['edit_alink'][$alink['id']]['start_boundary_edit']), 'align' => 'center');
...
...
$rows[] = $row;
}
}
This is pretty minor and perhaps obvious, but maybe disconcerting to non-coders/new Drupal users.
Attached a patch (my very first one!) rolled against RC1. Let me know if I did it right? :P
Comments
Comment #1
the_g_bomb commentedIs this issue actually with line 355.
if (count(db_fetch_array(($sql))) > 0) {The count() is always returning a value higher than 0, even when there are no links defined.
IMHO It might be a better idea to fix this rather than fixing what happens if an empty array is passed to theme_alinks_list($form).
Comment #2
the_g_bomb commentedOK not enough action here, so I made the change. And tidied up the code to appease coder.
Main change for this issue
Comment #3
the_g_bomb commentedThis is probably a bit better, sorry
Comment #4
greg boggs