I've attached a patch I generated to fix this, basically, you'd done:

/**
 * Implementation of hook_link().
 */
function upload_image_link($type, $node = 0, $main = 0) {
  $links = array();
  // Display a link with the number of attachments
  if ($type == 'node' && $node->type == 'image') {
    $image = db_fetch_object(db_query('SELECT u.oid, n.title, n.uid FROM {upload_images} u INNER JOIN {node} n ON u.oid = n.nid WHERE u.nid = %d', $node->nid));
    if ($image->oid) {
      $links['upload_image_link'] = array(
        '#title' => t('parent post: %title', array('%title' => check_plain($image->title))),
        '#href' => url('node/'. $image->oid),
        '#attributes' => array('title' => t('Read parent post to view all attached images.'))
      );
    }
  }

  return $links;
}

where it should have been:

/**
 * Implementation of hook_link().
 */
function upload_image_link($type, $node = 0, $main = 0) {
  $links = array();
  // Display a link with the number of attachments
  if ($type == 'node' && $node->type == 'image') {
    $image = db_fetch_object(db_query('SELECT u.oid, n.title, n.uid FROM {upload_images} u INNER JOIN {node} n ON u.oid = n.nid WHERE u.nid = %d', $node->nid));
    if ($image->oid) {
      $links['upload_image_link'] = array(
        'title' => t('parent post: %title', array('%title' => check_plain($image->title))),
        'href' => url('node/'. $image->oid),
        'attributes' => array('title' => t('Read parent post to view all attached images.'))
      );
    }
  }

  return $links;
}

This resulted in me seeing a blank link button at the end of my image nodes.

Thanks for this fantastic module though!

Comments

nicholasthompson’s picture

Title: Mistake in hook_links - used hash where it shouldn't have been used. » A few mistaks in hook_links (hash + url() call not needed)

Another error...

'#href' => url('node/'. $image->oid),

should be

'href' => 'node/'. $image->oid,

I'll submit a patch for this in a minute.

nicholasthompson’s picture

StatusFileSize
new1.13 KB

New patch...

drewish’s picture

Status: Needs review » Fixed

yeah, looks like the parameters were wrong: http://drupal.org/node/64279#handling-of-links

i've committed this to HEAD and DRUPAL-5

Anonymous’s picture

Status: Fixed » Closed (fixed)