If another module defines unique targets using hook_feeds_node_processor_targets_alter(), they should be honored by FeedsNodeProcessor.
I'm not sure if this is a bug report or a feature request, but if we can set a target's uniqueness via the hook, it seems to me that we should also expect it to be honored.
After looking over the code I can see how this might be done for CCK fields, but I'm not sure beyond that - I'd be happy to whip up a patch if it would be useful, otherwise perhaps I ought to just implement my own processor?
Comments
Comment #1
awjrichards commentedOn account of my ignorance, it didn't occur to me that this wouldn't really make sense to implement a blanket solution for CCK fields due to the different ways they may store data/mappers might work/etc.
So on second thought, perhaps it would make more sense to expose a hook for determining uniqueness of 3rd party specified targets. I'll work on a patch.
Comment #2
awjrichards commentedPatch attached for exposing a hook in FeedNodeProcessor to allow 3rd parties to determine uniqueness of targets.
Comment #3
alex_b commentedI agree that unique support would be only consistent.
I am not happy about the drupal_alter() though as the problem we're trying to solve is better served with a single callback rather than a wholesale alter call to all modules.
If we require implementers of
hook_feeds_node_processor_targets_alter()to specify a unique callback we could invoke this callback in existingItemId().The return value of uniqueTargets() needs to be modified slightly to obtain the value of 'unique' of course.
Having a 'callback' and a 'unique' key that both take a callback is a little funny, but we could come up with a better key name for 'callback' - for instance 'mapper'.
Comment #4
awjrichards commented@alex_b I like the approach and it makes a lot of sense, I think it is more consistent with the Feeds style
Comment #5
alex_b commentedNW (see #3)
Comment #6
twistor commentedWork is being done here.
#661606: Support unique targets in mappers