Closed (fixed)
Project:
Image
Version:
6.x-1.0-alpha5
Component:
image_attach
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Oct 2009 at 12:52 UTC
Updated:
9 Oct 2009 at 09:32 UTC
I am currently running 6.x-1.0-alpha5. I tried to move over to beta 3 and had problems with image attach... specifically that the images did not actually display on the pages. I made sure to add the new permissions, and even tried deleting the block based on some of the comments in the release node... without any success.
I put the code back in place for alpha 5 but the db is still the newer version.
Anyone else have this problem?
Thanks,
tdivito
Comments
Comment #1
joachim commentedDo you mean the actual Block, rather than just the attached images in the node?
I don't think I changed any theme functions for that, but try clearing all your caches including the theme registry.
Comment #2
tdivito commentedI don't think I have been using a block... unless a block is placed inside of the node's content.
Inside of the node's content div, I saw a div named image-attach-body... but nothing else was in the div.... it was empty.
How to I clear cache for the theme registry... I have been clearing the cache using admin/settings/performance and that did not help.
Thanks for your help!
Comment #3
joachim commentedI think someone filed a similar problem recently. Try looking in the issue queue to see how that was resolved.
You clear the theme registry by visiting the theme admin page IIRC -- check the docs.
Comment #4
tdivito commentedClearing theme registry did not help.
I found something in the issue queue about this problem when running drupal from a sub directory, which I am not doing, and that issue was found to be being caused by a module that I don't use anyway.
Thanks for helping me with this!
Comment #5
joachim commentedThe DIV with class image-attach-body is produced by theme_image_attach_body.
Can you check by overriding that in your theme whether it gets called and what parameters it is receiving?
Comment #6
tdivito commentedI know how to override the function, but how do I find out what parameters it is receiving?
Thanks!
Comment #7
joachim commentedInstall devel module, do:
dsm($variable);
Comment #8
tdivito commentedSo, um.... I am pretty sure that I was causing the problem myself. I knew how to override the template function because I did it already in order to display captions under the images on the nodes. Sorry for the false alarm
Could you take a quick look at the code (which I pulled from someone else's help ticket somewhere) and see if anything seems really wrong based on the new version?
Thanks so much for all of your help!
function phptemplate_image_attach_body($node) {
$img_size = variable_get('image_attach_size_body_'. $node->type, IMAGE_THUMBNAIL);
if ($img_size != IMAGE_ATTACH_HIDDEN) {
drupal_add_css(drupal_get_path('module', 'image_attach') .'/image_attach.css');
$image = node_load($node->iid);
if (!node_access('view', $image)) {
// If the image is restricted, don't show it as an attachment.
return NULL;
}
$info = image_get_info(file_create_path($image->images[$img_size]));
$caption = node_teaser($image->body);
$output = '
$output .= l(image_display($image, $img_size), "node/$node->iid", array('html' => TRUE));
$output .= '
';
$output .= '
'."\n";
return $output;
}
}
Comment #9
joachim commentedYour theme function looks fine.
Note that it gains an extra parameter for DRUPAL-6--1-0-ALPHA6.
I've made a patch to improve the theming functions anyway: if you are able, please test: #412288: restructure theme_image_attach_body/teaser .