Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
If a CCK ImageField is configured to support multiple values, then the Media RSS module generates incorrect output. Specifically, it appears to repeat the first value in multiple mediarss xml nodes.
The use case here is that a view should be created to return all of the ImageField values in MediaRSS format for a single node:
http://examples.com/node/nid/images - returns mediaRSS xml for just that node.
Problem could be in the iterator:
if(module_exists('imagefield') && $item->type==$mediarsstype){
foreach($imagefields as $imagefield){
if($item->{$imagefield}[0]['filepath']){
$imagecache = $this->options['mediarss_cachepreset'];
$picture_text = l(theme('imagecache', $imagecache, $item->{$imagefield}[0]['filepath']), url("node/".$item->nid), array('html' => TRUE));
$attributes['url'] = file_create_url($item->{$imagefield}[0]['filepath']);
$media['url'] = $attributes['url'];
$media['type'] = file_get_mimetype($item->{$imagefield}[0]['filepath']);
$extra = array_merge($extra,
array(
array('key' => 'media:content', 'attributes' => $media),
array('key' => 'media:thumbnail', 'attributes' => $attributes),
)
);
}
}
Comments
Comment #1
Microbe CreditAttribution: Microbe commentedproblem was it was looking at
$item->{$imagefield}[0]['filepath']
whereas there could also be a picture underit now cycles through all existing values and enters them all