Currently Feeds implements one possible option for all targets — UNIQUE.
Why not to go further and add NOT NULL field option? This would allow to skip source records which doesn't conform some criteria.
Simplest case: skip records where specific field is empty.
More intricate case: skip records which rewritten (e.g. by Feeds Tamper) field values is empty.
Implementation seems to be pretty evident. In FeedsProcessor->map()
function before settings values with setTargetElement()
or with target's callback, check the $value
and if it is empty (all elements of the array is empty) then return NULL instead of $target_item. Correspondingly, in process() — just skip importing.
Thoughts?
Comments
Comment #1
OnkelTem CreditAttribution: OnkelTem commentedComment #2
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedI think the "Required field" plugin from Feeds Tamper can handle this? Anyway, if it doesn't, then this feature request would fit better in Feeds Tamper. Setting to "fixed" assuming that the "Required field" plugin does the trick.
Comment #3
MegaChriz CreditAttribution: MegaChriz as a volunteer commented