Mapping an Image within an enclosure as a CCK-Link

Jan Krummrey - January 9, 2009 - 15:15
Project:Feed Element Mapper
Version:6.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

I'm trying to map this element:

[enclosures] => Array
                (
                    [image] => Array
                        (
                            [jpeg] => Array
                                (
                                    [0] => Array
                                        (
                                            [bitrate] =>
                                            [...]
                                            [length] => 1887
-->                                         [link] => http://img.stern.de/_content/65/06/650637/Travolta1_80.jpg

to this field:
options->enclosures->image->jpeg:
Map to field_remote_rss_link (link)

If I manually enter it, it works like a charm.
Mapping it from a RSS-feed just generates empty nodes. (No title, no body, nothing)

Can anyone help me to get this going?

#1

jpp - January 9, 2009 - 18:42

I have a similar issue with options->enclosures->audio->mpeg field that I'l like to map to a link - I get the same result - empty nodes.

I'm also a little confused as to why all the subfields show up in the From Field Example section but don't show up as mappable items down the page.

The feed in question is here: http://feeds.feedburner.com/SexLoveAndIntimacy

#2

jpp - January 12, 2009 - 02:19
Title:Mapping an Image within an enclosrue as a CCK-Link» Mapping an Image within an enclosure as a CCK-Link
Category:support request» bug report

Changed to a bug report -

I did major surgery on feedapi_mapper_link.inc - (borrowed heavily from the emvideo mapper) the bug causing blank nodes is the "return $node" line that needs to be outside the } below it. While I was messing with it I made it work with returned arrays like the ones found in media rss - it's working fine now for my mpeg attachments.

The file is so small I just attached it rather than a patch.

EDIT - use the file further down this one has a bug

AttachmentSize
feedapi_mapper_link.inc_.zip 1.11 KB

#3

Jan Krummrey - January 10, 2009 - 17:57

The new mapper works! Great.

However, I get this error when enabeling your patch:

recoverable fatal error: Object of class stdClass could not be converted to string in /Applications/MAMP/htdocs/drupal-6-multi-acquia/sites/all/modules/feedapi_mapper/feedapi_mapper.module on line 81.

Do you have the same?

#4

jpp - January 12, 2009 - 02:18

Got it - I needed to return FALSE for the description if it wasn't a link field type. This should work.

AttachmentSize
feedapi_mapper_link.inc_.zip 1.13 KB

#5

jpp - January 12, 2009 - 05:59
Status:active» needs review

#6

alex_b - January 12, 2009 - 13:47
Status:needs review» needs work

Please submit patches in the right format - you make reviewing much easier that way - http://drupal.org/patch/create

Thank you.

#7

jpp - January 12, 2009 - 19:48
Status:needs work» needs review

Here you go

AttachmentSize
feedapi_mapper_link.inc_.patch 2.51 KB

#8

Jan Krummrey - January 15, 2009 - 15:51

Patch works for me.

#9

alex_b - January 16, 2009 - 20:13

#7 @jpp: there is still a problem with the formatting of the patch :-)

Are you using tabs for indents? It should be spaces - 2 spaces per indent...

#10

alex_b - January 16, 2009 - 20:13
Status:needs review» needs work

#11

Jan Krummrey - January 19, 2009 - 13:33

I grabbed the previous patch and detabbed it with 2 spaces.
Does it go through now?

AttachmentSize
feedapi_mapper_link.inc_.patch 2.53 KB

#12

szy - November 6, 2009 - 09:51

*cut*, sorry, wrong thread.

Szy.

 
 

Drupal is a registered trademark of Dries Buytaert.