I'm using the feeds module to pull in a set of publications into a Drupal content type. I have two separate feeds, which I hoped would work as follows:
Feed 1 - pulls in most of the fields
Feed 2 - accesses a separate url source and updates one field on the content type.
The problem I have is that feed 2 always creates a new set of nodes rather than updating the existing nodes (that were created using feed 1), despite the GUIDs being identical. I have looked at the feeds_items database table and it appears that each feed creates it's own set of GUID to entity_id mappings.
What I want to achieve is one of the following:
1. Allow feed 2 to update the same nodes as feed 1.
OR
2. Allow both URL sources to be used in one feed.
Is there any way to do this with custom code or otherwise?
Comments
Comment #1
littledynamo CreditAttribution: littledynamo commentedI knocked something together that allows my second feed to update the nodes from my first feed. Not sure if this is the right way of doing things but it works. Here's what I did in case it helps someone else in future:
- Created a custom processor that extends FeedsNodeProcessor
- Copied across all of FeedsNodeProcessor's functions to the new class.
- Overrided the existingEntityId function as follows (harvard_format is my secondary feed and pure_feed is my primary feed):
- Copied across the the Process and newItemInfo functions from FeedsProcessor.
- Overrided newItemInfo as follows:
Comment #2
littledynamo CreditAttribution: littledynamo commentedComment #3
littledynamo CreditAttribution: littledynamo commentedI made life difficult for myself by creating a fork of the Node Processor, this issue is a duplicate of https://drupal.org/node/1539224 (issue contains a patch).