We need to pass a copy of the current field data to the mappers. I have came across two mappers where this is needed:
- File mapper
- When we return a blank than the current image will be removed.
- https://drupal.org/node/2049341
- Taxonomy mapper
- When we return a blank than the current terms will be duplicated.
- https://drupal.org/node/2033519
This is pretty closely tied with: https://drupal.org/node/1107522
Do we create a separate patch for this issue or do it in the framework patch? (https://drupal.org/node/1107522)
Another thing is, which way would be take this? Do we just send a complete copy of the current entity to the mappers and let the mappers handle getting the current field value, or do we do it in FeedsProcessor and only send a copy to the mapper so that the mapper get's it's own field value and doesn't have to do much more logic? I am willing to create a patch, just would like to know which way the maintainers want to take.
Comments
Comment #1
Michsk CreditAttribution: Michsk commentedTough in my opinion mappers shouldn't do to much logic to get the current field value, if we would send the complete entity to the mapper, we would tackle the multilingual option for the future, since we would also know what language the entity currently is in. Of course we could send the current language with the field copy.
Comment #1.0
Michsk CreditAttribution: Michsk commentedmade it more beautifull