Hi,

I have a feed that may contain for each item:

  • property1
  • (property2)

property1 is always present and has a value, while property2 sometimes just doesn't exist.

Is there a way during the mapping that property2 is put into my_custom_field only if it exists, otherwise put property1?

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ludo.R’s picture

Issue summary: View changes
twistor’s picture

Category: Support request » Feature request

This is theoretically possible. We'd need to add an option to the copy plugin to only copy if not empt(). Then you could copy property1, then conditionally copy property2.

Ludo.R’s picture

Status: Active » Needs review
FileSize
1.19 KB

Something like this?

I'm not sure about the to/from thing, maybe the option checkbox is not enough to cover all use cases, and I'm also a bit confused with the terminology about source (which one is the source when selecting to/from?).

To summarize, maybe there should be an option like "don't copy if source is empty" and another one "don't copy if destination is empty"

Status: Needs review » Needs work

The last submitted patch, 3: feeds_tamper-2528326-3.patch, failed testing.

Ludo.R’s picture

Small fix (syntax error)

twistor’s picture

Status: Needs work » Needs review
Blanca.Esqueda’s picture

I had a similar situation where if a value was empty then another field value needed to be used.
I created a path for the rewrite plugin as it has the flexibility not only to use a replacement patterns but as well a custom strings, or a mix of both.

http://www.drupal.org/node/2632056