Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Many thanks for this great module.
Is there a way to add the Feed title to the list of sources for mapping purposes?
For example, say I have two feeds AM-Radio and FM-Radio, I would like to import the feed into a CCK node type which has an additional text feed to hold AM-Radio or FM-Radio.
Comments
Comment #1
DanielR CreditAttribution: DanielR commentedI've made a bit of progress. It seems the best way to use feed item inheritance, rather than mapping.
In FeedsNodeProcessor.inc, function getInheritors(), I added:
And then I added the callback function:
This fails with an unusual error message, because I'm using $item_node->field_feed. If I use something else like $item_node->title, it's OK. Can anyone suggest how I might poke the value into a CCK field? Sorry, I'm a total newbie. The error message is below:
An error occurred. /batch?id=21&op=do <br /> <b>Fatal error</b>: Cannot unset string offsets in <b>/var/www/paperfeed.org/sites/all/modules/cck/content.module</b> on line <b>1248</b><br />
(Yes, the html tags show up unrendered)
Comment #2
DanielR CreditAttribution: DanielR commentedChanged the name of the issue, to avoid misleading mention of mapping.
Comment #3
DanielR CreditAttribution: DanielR commentedSome further progress. The following syntax works for setting the CCK field (see previous comment):
$item_node->field_feed[0]['value'] = $feed_node->title;
Please consider this issue closed as far as I'm concerned.
Comment #4
DanielR CreditAttribution: DanielR commentedI'd like to reopen this issue - I still feel it adds a lot of value to the module if feed items can inherit the title of the feed they come from. I think I was incorrect in closing it earlier when I found a workaround.
Sorry if I have overstepped the bounds of etiquette here. I'm very new to drupal.org.
Comment #5
alex_b CreditAttribution: alex_b commentedThis feature makes sense. I suggest using the mapping API for implementing it. The mapping API is actually designed for item to item mapping, so OTOH, I can't tell whether using feed properties themselves would lead to very nasty code.
Comment #6
alex_b CreditAttribution: alex_b commentedHm - on a second thought, some of the functionality in #632920: Inherit properties from parent feed node (taxonomy, author, OG, language) could be implemented as mapping sources, too. Just a thought.
Comment #7
kenorb CreditAttribution: kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.