Exploding a source Feed:SomeField doesn't work

Created on 27 April 2020, over 4 years ago
Updated 30 May 2023, over 1 year ago

Exploding doesn't work when the source is Feed:SomeField.

IE when the source is a field from the feed itself, eg "Feed: Title", it won't explode into an array.

Instead the Target field is populated with a single string: "Array".

To generate error:
- In the Feeds Mapping, map: Source("Feed Title") to Target("some_field_w_unlimited_allowed_values")
- In the Feeds Tamper, add Explode plugin with comma string separator
- Add a new Feed, and give it a title with a comma, eg "foo,bar"
- Run the import
- The value in your Target field will be "Array" rather than "foo" and "bar"

This is the case with any custom field on the feed, not just title.

🐛 Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇵🇹Portugal jrochate

    I'm having the same problem, but I found out that Explode Tamper is not causing the problem.

    The output of Explode is always a simple array, when using fields from the feed itself (like Feeds: Source or Feeds: Title).
    It's the same output if with set a value a blank source like the values on the feeds fields.

    So, Explode Tamper is building the array correctly.

    What happens next looks like a Feeds problem, where the module encapsulates the $data result from Explode Tamper on a array, making something like this:

    array:1 [▼
      0 => array:8 [▼
        0 => "https:"
        1 => ""
        2 => "xx.xxxxxx.xx"
        3 => "api"
        4 => "v1"
        5 => "cuc"
        6 => "E239"
        7 => "a-id"
      ]
    ]

    Why Feeds is doing this is something beyond my knowledge. I have made a custom Tamper just to reduce this array dimension :(

  • Status changed to Closed: works as designed over 1 year ago
Production build 0.71.5 2024