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.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | 878002-5_multiple.patch | 1.34 KB | alex_b |
#3 | 878002_3.patch | 1.15 KB | David Goode |
#1 | 878002_1.patch | 912 bytes | Will White |
Comments
Comment #1
Will White CreditAttribution: Will White commentedThis 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.
Comment #2
alex_b CreditAttribution: alex_b commentedWe 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.
Comment #3
David Goode CreditAttribution: David Goode commentedFix 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).
Comment #4
alex_b CreditAttribution: alex_b commentedTo be released w/ 6.x-1.0-beta5.
Comment #5
alex_b CreditAttribution: alex_b commentedWe 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.
Comment #6
alex_b CreditAttribution: alex_b commentedCommitted, thank you.
http://drupal.org/cvs