Closed (duplicate)
Project:
Upload Image
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Oct 2007 at 08:24 UTC
Updated:
17 May 2009 at 10:40 UTC
upload.module by default does not display its upload_attachments table in teasers (its output depends on the condition !$teaser).
upload_image calls upload_attachments as follows (starting line 96):
// Add the attachments list
if (count($node->no_images)) {
$node->content['files'] = array(
'#value' => theme('upload_attachments', $node->no_images),
'#weight' => 50,
);
}
causing attachments that are not images to be displayed even in teaser view. This can be solved by changing the above code to:
// Add the attachments list
if (count($node->no_images) && !$teaser) {
$node->content['files'] = array(
'#value' => theme('upload_attachments', $node->no_images),
'#weight' => 50,
);
}
I'm still new to this and have not yet looked into how to create a patch. I hope this is helpful "as is".
Comments
Comment #1
sebxian commentedAlso, I'm not sure I understand the whole structure of the code. Maybe it would be good to handle the upload_attachments in theme_upload_images(), theme_upload_images_body(), and theme_upload_images_teaser() ?
Or in another way that makes it easier to override upload_image standard settings in template.php, as I did with theme_upload_images_teaser() to remove the thumbnails from my teasers.
Comment #2
killes@www.drop.org commentedhttp://drupal.org/node/238342