? .DS_Store
Index: imagecache.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagecache/imagecache.module,v
retrieving revision 1.112
diff -u -p -r1.112 imagecache.module
--- imagecache.module	7 May 2009 15:15:04 -0000	1.112
+++ imagecache.module	4 Jun 2009 14:56:30 -0000
@@ -657,8 +657,12 @@ function imagecache_field_formatter_info
 }
 
 function theme_imagecache_formatter_default($element) {
-  // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  $field = content_fields($element['#field_name']);
+  $item = $element['#item'];
+  module_load_include('inc', 'filefield', 'filefield_formatter');
+  
+  // Inside a view $element may contain null data or file may not be listed. In that case, just return.
+  if (empty($element['#item']['fid']) || !filefield_file_listed($item, $field)) {
     return '';
   }
 
@@ -676,8 +680,12 @@ function theme_imagecache_formatter_defa
 }
 
 function theme_imagecache_formatter_linked($element) {
-  // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  $field = content_fields($element['#field_name']);
+  $item = $element['#item'];
+  module_load_include('inc', 'filefield', 'filefield_formatter');
+  
+  // Inside a view $element may contain null data or file may not be listed. In that case, just return.
+  if (empty($element['#item']['fid']) || !filefield_file_listed($item, $field)) {
     return '';
   }
 
@@ -696,8 +704,12 @@ function theme_imagecache_formatter_link
 }
 
 function theme_imagecache_formatter_imagelink($element) {
-  // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  $field = content_fields($element['#field_name']);
+  $item = $element['#item'];
+  module_load_include('inc', 'filefield', 'filefield_formatter');
+  
+  // Inside a view $element may contain null data or file may not be listed. In that case, just return.
+  if (empty($element['#item']['fid']) || !filefield_file_listed($item, $field)) {
     return '';
   }
 
@@ -716,8 +728,12 @@ function theme_imagecache_formatter_imag
 }
 
 function theme_imagecache_formatter_path($element) {
-  // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  $field = content_fields($element['#field_name']);
+  $item = $element['#item'];
+  module_load_include('inc', 'filefield', 'filefield_formatter');
+  
+  // Inside a view $element may contain null data or file may not be listed. In that case, just return.
+  if (empty($element['#item']['fid']) || !filefield_file_listed($item, $field)) {
     return '';
   }
 
@@ -728,8 +744,12 @@ function theme_imagecache_formatter_path
 }
 
 function theme_imagecache_formatter_url($element) {
-  // Inside a view $element may contain NULL data. In that case, just return.
-  if (empty($element['#item']['fid'])) {
+  $field = content_fields($element['#field_name']);
+  $item = $element['#item'];
+  module_load_include('inc', 'filefield', 'filefield_formatter');
+  
+  // Inside a view $element may contain null data or file may not be listed. In that case, just return.
+  if (empty($element['#item']['fid']) || !filefield_file_listed($item, $field)) {
     return '';
   }
 
