I have installed imagecache (6.x-2.0-beta10) and comments_upload (6.x-1.x-dev (2009-Dec-01). For one node type I am using 'image attachments on comments' with imagecache. But when viewing comments for that node type I am seeing uploaded images and not images from imagecache.
Problem is in comment_upload.module on line 361:
361: if (is_numeric($display_setting)) {
362: $imagecache_preset = imagecache_preset($display_setting);
363: $preset_name = $imagecache_preset['presetname'];
364: }$display_setting is a string and can not be a number:
357: $display_setting = variable_get('comment_upload_images_'. $node->type, 'none');
Imagecache is storing presets like strings and not numbers (maybe it stored preset ids in some previous version and this code worked) but with latest version it is not working.
After removing that if (is_numeric($display_setting)) everything is working fine.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | comment_upload_imagecache_integration.patch | 638 bytes | nestorconde |
Comments
Comment #1
heine commentedComment #2
pivica commentedOne little update, because we now have preset name it seems that code
is not needed anymore. I have tested next code
and its working fine.
Comment #3
nestorconde commentedThe proposed correction in #2 worked for me. I attach the patch
Comment #4
Andrew44 commentedHi,
I think this is something to do with the problem I am having but I'm no expert, just learning.
I use comment uploads too. When I upload a comment I want to see a preview of the image and then click on it to have lightbox2 to expand the image out.
I applied the patch but when I do that I just see the name of the file and then when I click on that link it takes me to the image without opening it in lightbox.
In lightbox I went into custom handling and set the custom trigger class as
comment-upload-images
Why wont it work?
Thanks in advance,
Andrew
Comment #5
MafiaMoe commentedGo into Administer > Content Management > Content Types, and edit the Forum Post type. Under comments, change the 'Image attachments on comments:' to 'via imagecache thumbnail'.
That solves on issue, how to view it using lightbox2 is something I am still looking into (I have admittedly only been looking into this for a grand total of 10 minutes).
Comment #6
lupus78 commentedI have a solution for lighbox:
1. copy the comment-upload-attachments.tpl.php file from the module folder into your themes folder.
2. edit the linke where the image is linked:
from this:
to this:
Comment #7
the_g_bomb commentedI just updated and noticed this issue, patch at #3 solves and lightbox solution at #6 works as well. It would be handy if there was only one issue to deal with here, but as the patch needs to get in to fix this issue I am marking RBTC.