Closed (fixed)
Project:
ImageCache
Version:
6.x-2.0-beta2
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Mar 2010 at 20:01 UTC
Updated:
24 May 2012 at 08:04 UTC
There are instances in which theme_imagecache will be called but nothing will be passed as a path. In my case, it was when I created a view of nodes with emfield videos, which use the emthumb feature that sends video thumbnails to imagecache. In the rows in which nodes had no video loaded in the emfield video field, imagecache still tries to process the thumbnail and produces a broken img tag.
I overrode theme_imagecache in my theme, adding the lines
if (is_null($path)) {
return '';
to the top of the function. I wonder if something like this should be in the module itself to make sure no broken images are produced i these cases.
Comments
Comment #1
goto10 commentedI'm having the same problem!
If this is a fix that works, I'd love to implement it. However, the images in question are being displayed by a view and not by a theme function. Where would I drop this statement?
Also of note is a solution in the emfield issues: http://drupal.org/node/692956#new692956
Thanks!
-Jesse
Comment #2
dafederHere is the full theme function in my template.php.
Comment #3
danny englander#2 worked for me, thanks, I thought this was going to be another needle in a haystack until I came across this page -- it that works great!
Comment #4
PMorris commentedYou rock for posting this. Works perfect. I had some styles on my tags that I really wanted to keep, but having those empty divs and broken link everywhere in the html was driving me nuts
Comment #5
thrash632 commentedI tried copying and pasting the code in #2 at the top of my template.php file, but it didn't do anything :(
Do I have to modify it in anyway first?
Here is an example:
http://www.adambadlotto.com/work/branding/dj-rob-riggs-identity
Comment #6
danny englander@thrash632, did you change "THEMENAME" to the name of your theme and then clear the cache?
Comment #7
thrash632 commentedI missed the part about the theme name. It's working now. My bad!
While this does remove the thumbnail, the label for the field is still being generated.
Here is an example:
http://www.adambadlotto.com/work/branding/peace-studies-identity
Is there a way to tell it to hide the field label as well?
Thanks.
Comment #8
thrash632 commentedAlso, the overlayed play button still displays too. You won't see it in the example I provided because I turned off the overlay button for the time being. I'm referring to the overlay image that emfield generates.
I can't figure out if this is an emfield issue or an imagecache issue. I wish a fix would come out though.
Comment #9
danny englanderYou may need to make a custom-node.tpl.php with custom fields theming and a php if statement to hide if the field is empty.
Comment #10
thrash632 commentedI wish I could, I'm not all too familiar with PHP at all :-/
Maybe someone could throw together some php for me ;-) I'm sure others would find it useful as well.
Comment #11
fizk commented