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>&lt;p&gt;Очень хороший мультфильм&lt;/p&gt;</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.

Comments

e2thex’s picture

Assigned: Unassigned » e2thex

Thanks for finding this (and submit the patch) I will try and add it in this weekend.

e2thex’s picture

Status: Patch (to be ported) » Fixed

Ok I committed this patch and release a new alpha http://drupal.org/node/473702

thanks again

pavel.karoukin’s picture

always welcome. thanks for module! =)

Status: Fixed » Closed (fixed)

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