enabled: cck / imagefield / imagecache / thickbox
by calling
<?php print $node->field_property_image[0]['view'] ?>
output is created by imagecache even when no image has been uploaded (no image exists). output is of the type:
<a href="http://localhost/drupal/files/" class="thickbox" rel="property"><img src="http://localhost/drupal/files/imagecache/99x66-property" alt="" title="" /></a>
therefore, browser displays "default missing image" (small square with red cross).
imagechache should not be creating any output when no image exists.
could this be kindly fixed?
many thanks,
abramo
Comments
Comment #1
dodorama commentedI'm experiencing the same issue.
I have imagefield/imagecache and thickbox installed.
I set the imagecache+thickbox formatter in the display field.
Then I uploaded an image.
Later I deleted the image from the content type.
The image tag is still there but with no link.
Comment #2
kalashari commentedI also need this feature. It should either display no image or display some "default" image.
Comment #3
abramo commentedthis also happens when there is a php snippet in the template (ex. contemplate) calling for an image and an image is not actually available/uploaded respective to this call. example: the snippet
calls for image main_image but if this has not been uploaded by the user imagecache creates output without an image - therefore the browser displays the ugly image placeholder (with red x) instead of leaving the place blank.
Comment #4
jpetso commentedI don't have thickbox enabled, but this happens here at well. It seems that the image doesn't display at first, but when some image is uploaded and afterwards deleted again, its entry stays in the {content_type_TYPE} table even if the image is deleted from the {files} table.
I'm not yet as far into CCK as to know how to get the entry in {content_type_TYPE} deleted (I guess something must be done in imagefield_field(), but no idea what exactly has to be written there), but there's some lines in image{field,cache}_formatter() that should be there anyways. That's a simple check (on displaying) if the file could be retrieved, and if it could not be retrieved, don't attempt to show it.
Please review and commit (applies to the DRUPAL-5--2 branch).
Comment #5
jpetso commentedThis issue is supposed to get the real fix done.
Comment #6
abramo commented@jpatso : many thanks for your work on this issue, and making it available.
regrettably the proposed patch does not work.
Comment #7
abramo commentedcorrection:
@jpetso : many thanks for your work on this issue, and making it available.
regrettably the proposed patch does not work.
Comment #8
jpetso commentedClosing this issue, as the bug is not in imagecache but in imagefield (has been linked above).