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!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | upload_image.module_0.patch | 1.13 KB | nicholasthompson |
| upload_image.module.patch | 1.14 KB | nicholasthompson |
Comments
Comment #1
nicholasthompsonAnother error...
should be
I'll submit a patch for this in a minute.
Comment #2
nicholasthompsonNew patch...
Comment #3
drewish commentedyeah, looks like the parameters were wrong: http://drupal.org/node/64279#handling-of-links
i've committed this to HEAD and DRUPAL-5
Comment #4
(not verified) commented