Hello,
While trying to import media content from feeds I've found that code like:
<item>
<title>Крошка Енот</title>
<link>http://video.yandex.ru/users/elen2407/view/2/</link>
<description><p>Очень хороший мультфильм</p></description>
<guid isPermaLink="false">Prerx0hG3hGGBTb1PhJ3AQ_3f440ce2de11998b02e3b91be0bf3df5</guid>
<pubDate>Wed, 20 May 2009 12:11:14 -0700</pubDate>
<media:content url="http://flv.video.yandex.ru/lite/elen2407/ip4vt9dghv.803/1.swf"/>
<media:thumbnail url="http://flv.video.yandex.ru/get/elen2407/ip4vt9dghv.803/1.120x72.jpg"/>
</item>
, makes media:content and media:thumbnail to be absolutelly empty (i.e. attribute 'url' is lost).
Here is quick and dirty patch to feedapi_parser_exhaustive.module:
(line #150) instead:
$r = $node->nodeValue;
place:
if ($node->hasAttributes()) {
foreach ($node->attributes as $attr_node) {
$r['@'. $attr_node->name] = $attr_node->value;
}
$r['#text'] = $node->nodeValue;
} else {
$r = $node->nodeValue;
}
Unified patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| feedapi_parser_exhaustive.module.patch | 610 bytes | pavel.karoukin |
Comments
Comment #1
e2thex commentedThanks for finding this (and submit the patch) I will try and add it in this weekend.
Comment #2
e2thex commentedOk I committed this patch and release a new alpha http://drupal.org/node/473702
thanks again
Comment #3
pavel.karoukin commentedalways welcome. thanks for module! =)