Problem/Motivation
My feed is creating content that is identified (as unique) by 2 fields, but just 1 is used in the mapping, resulting in multiple Updates of the same content item for different inputs/fields.
Steps to reproduce
- Create a content type "Account" and add 2 fields: name, address
- Set name and address fields to be unique (using unique_content_field_validation module).
- Create a feed type processing nodes of type Account, with settings: Insert new content items, Update existing content items.
- Set Mapping settings:
- - Context = account_responses
- - New Json source = account.name -> target: field_name
- - New Json source = account.address -> target: field_address
Create and import a feed that produces this input:
{
"account_responses": [
{
"account": {
"name": "xxx",
"address": "yyy"
},
"balance": {
"denom": "aaa",
"amount": "111"
}
},
{
"account": {
"name": "xxx",
"address": "zzz"
},
"balance": {
"denom": "bbb",
"amount": "222"
}
}
],
"other_stuff": {}
}
Get this Output:
Created 1 Response (node 1: name = www
, address = yyy
)
Updated 1 Response (node 1: name = www
, address = zzz
)
So you are left with only 1 content item (the second in the input).
Proposed resolution
I'm filing this issue as a bug since by default the module UI allows to mark multiple targets to be unique.
In that case, we should check for a join/concatenation of the values.
Is it even possible?
Remaining tasks
User interface changes
API changes
Data model changes