Currently, if you map more than one source to a given target, each subsequent source simply overwrites it's predecessor. We would like to support more than one source to be mapped to a given target.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Will White’s picture

FileSize
912 bytes

This patch checks to see if a target value already exists as an array. If it does, and if the value is also an array, it merges them together.

alex_b’s picture

We should add a test for this. Very simple:

- configure importer that uses multiple sources per target.
- import feed, check.
- clear feed.
- enable 'replace existing'.
- import feed, check.

Should be added to the feeds module's tests.

David Goode’s picture

FileSize
1.15 KB

Fix to avoid setting non-empty values to empty ones (this was a previously present behavior, not caused by patch, but probably exposed because rare to use multiple mappings previously).

Also preliminarily added (w/o testing) the same support for the joined tables in the data processor. We should probably add this functionality to all the relevant default processors before committing... (as well as doing tests).

alex_b’s picture

Issue tags: +6.x-1.0-beta5

To be released w/ 6.x-1.0-beta5.

alex_b’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
1.34 KB

We shouldn't need merged arrays for fields of the main table, only for fields in related tables. The main table can only store a single value anyway. We need to keep a check for wether value is empty though, I moved it all the way up.

Tests turn out actually to be hard to do in this scenario, we would have to set up a related table and map to it. Given that the modification winds up being very small we should be able to get away without it.

alex_b’s picture

Title: Allow mapping in FeedsDataProcessor to support multiple sources per target » Support multiple sources per mapping target in FeedsDataProcessor
Status: Reviewed & tested by the community » Fixed

Committed, thank you.

http://drupal.org/cvs

Status: Fixed » Closed (fixed)
Issue tags: -6.x-1.0-beta5

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