summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrel O\'Pry2008-04-19 17:44:28 (GMT)
committer Darrel O\'Pry2008-04-19 17:44:28 (GMT)
commit41b32b37a7a94c76f6dbaa36e51fb1114eca57a3 (patch)
treeab7a31c957da0d1dc59c1480ffafd0ab09ee8db7
parent7d06010fa8150db1b4fc5882b75b13eca9db9d58 (diff)
#210708 reported by ckng, Default image link to front page when using "as link to node" formatter.
use $node->nid instead of $item['nid'] when creating link.
-rw-r--r--imagecache.module4
1 files changed, 2 insertions, 2 deletions
diff --git a/imagecache.module b/imagecache.module
index 3a1b82a..a22fda1 100644
--- a/imagecache.module
+++ b/imagecache.module
@@ -543,7 +543,7 @@ function imagecache_field_formatter_info() {
/**
* Implementation of hook_field_formatter().
*/
-function imagecache_field_formatter($field, $item, $formatter) {
+function imagecache_field_formatter($field, $item, $formatter, $node) {
if (empty($item['fid']) && $field['use_default_image']) {
$item = $field['default_image'];
}
@@ -563,7 +563,7 @@ function imagecache_field_formatter($field, $item, $formatter) {
switch($style) {
case 'linked':
$imagetag = theme('imagecache', $presetname, $item['filepath'], $item['alt'], $item['title']);
- return l($imagetag, 'node/'. $item['nid'], array('class' => $class), NULL, NULL, FALSE, TRUE);
+ return l($imagetag, 'node/'. $node->nid, array('class' => $class), NULL, NULL, FALSE, TRUE);
case 'imagelink':
$original_image_url = file_create_url($item['filepath']);