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

the_g_bomb’s picture

Is 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).

the_g_bomb’s picture

StatusFileSize
new18.29 KB

OK not enough action here, so I made the change. And tidied up the code to appease coder.
Main change for this issue

  $count = db_result(db_query("SELECT * FROM {alinks} ORDER BY alink_weight, alink_text"));
  if ($count > 0) {
the_g_bomb’s picture

StatusFileSize
new18.27 KB

This is probably a bit better, sorry

  $count = db_result(db_query("SELECT COUNT(id) FROM {alinks}"));
  if ($count > 0) {
greg boggs’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)