Closed (won't fix)
Project:
ImageField
Version:
6.x-3.10
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2011 at 20:37 UTC
Updated:
14 Apr 2013 at 18:51 UTC
Hi,
I just looked into using theme('imagefield_item', $item) with the intention of passing in one item from a CCK image field, like: theme('imagefield_item', $node->field_callout_image[0]);.
I noticed this is just a shortcut that calls theme_imagefield_image(), but it passes in $item['alt'] and $item['title'] while the structure of the CCK field item array nests them: $item['data']['alt'] and $item['data']['title']. As a result, passing the CCK image field array as-is into theme_imagefield_item() passes nothing into the $alt and $title arguments in theme_imagefield_image().
So I'm guessing it should be:
function theme_imagefield_item($item) {
return theme('imagefield_image', $item, $item['data']['alt'], $item['data']['title']);
}
CCK version: 6.x-2.9
filefield version: 6.x-3.10
Comments
Comment #1
quicksketchThis looks like a nice catch to me, but I'm curious where else we're using theme_imagefield_item() and if it's not working anywhere that we're using it right now. Or if it is working right now, would it be broken by this change? This just needs a little investigating to see if we're going to break anything with this change, but it sounds like it's the right thing to do.
Comment #2
quicksketchHow strange. Looking into this more it looks like theme_imagefield_item() is not used anywhere for any purpose. So making this change seems like it would be unlikely to cause any problems... but really we could just delete the entire theme function since it's not being used. *However*, at this point in the D6 cycle I don't want to be deleting functions or changing a function's parameters. So although I think this report is accurate and the suggested change would be the right thing to do, I'd prefer to just leave this "broken" for the sake of preventing any breakage in upgrading. Thanks for the report and suggestion, you're completely right but in this situation stability is the most important thing.