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

Microbe’s picture

Version: 6.x-2.1 » 6.x-2.3
Status: Active » Fixed

problem was it was looking at $item->{$imagefield}[0]['filepath'] whereas there could also be a picture under

$item->{$imagefield}[1]['filepath']
$item->{$imagefield}[2]['filepath']
$item->{$imagefield}[3]['filepath']
......

it now cycles through all existing values and enters them all

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.