0

I'm importing a JSON feed into entries in my EE site (v2.9.2) using Solspace Importer (v2.2.5). Everything seemed to work fine - we've been using it in dev for weeks and have run many imports to update entries. Unfortunately, we just noticed that the data that is being imported into Matrix fields isn't keeping it's organization.

Here is an example node from the feed (I can't share the actual feed because it's sensitive data):

"Scott-Stephanie-2015-03-18-20:48:17": {
        "id": "2242e4a8-b2b2-3ada-adf9",
        "region": "Southwest",
        "text": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
        "link": "",
        "video": "",
        "first_name1": "Scott",
        "first_name2": "Stephanie",
        "title": "Our Family Profile",
        "status": "open",
        "paragraphs": [{
            "title": "Paragraph 1",
            "text": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
            "link": "https://www.example-image.com/image1.jpg"
        }, {
            "title": "Paragraph 2",
            "text": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
            "link": "https://www.example-image.com/image2.jpg"
        }, {
            "title": "Paragraph 3",
            "text": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
            "link": ""
        }, {
            "title": "Paragraph 4",
            "text": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
            "link": ""
        }, {
            "title": "Paragraph 5",
            "text": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
            "link": "https://www.example-image.com/image5.jpg"
        }, {
            "title": "Paragraph 6",
            "text": "Lorem ipsum dolor sit amet, consectetur adipisicing elit.",
            "link": "https://www.example-image.com/image6.jpg"
        }]
    }

You'll see there is a node called "paragraphs" that has values for "title", "text" and "link", the "link" being an image to go along with the paragraph. Unfortunately, there isn't always an image, so it may be empty.

The problem I'm having is that Importer is ignoring the empty values and grabbing the next available node. So, in the case of the example above, "image5.jpg" is getting placed in the Matrix row with "Paragraph 3" and "image6.jpg" is getting placed in the Matrix row with "Paragraph 4". The Matrix rows for paragraphs 5 & 6 will have empty "link" values in EE.

Here is a screenshot of my Importer setup for the "paragraphs" node: My 'paragraphs' node setup for Importer

Here is a screenshot of my Matrix settings: My Matrix row settings

I've tried to keep it as simple as possible. Any ideas what the issue is?

2
  • FYI... Since we're in a time crunch, we're working around the issue by simply using a default value ("no_image") in the JSON feed for the "link" nodes without content. While this is a good band-aid for THIS project, I'd like to still see if there is a valid answer to the issue. Others may not be able to make adjustments to their feed.
    – Boots
    Commented Apr 20, 2015 at 21:32
  • This definitely sounds like a bug in the add-on. It's likely that there's a bit of logic checking whether the value is empty() or not and thereby not adding the empty value to the array. -- You can narrow down the actual issue in PHP by locating the function in the module and tracking down where the field data is assembled and modifying the logic accordingly. Either way, this is definitely something I'd report to Solspace. It could result in a 2.2.6 after all... Commented Apr 22, 2015 at 6:56

1 Answer 1

0

This is a known issue in Importer. Cells with empty data get filled with other data similar to an "inverted Tetris game". The workaround is indeed to have empty cells contain anything but an empty string (can be - or no_image or anything that is not "nothing"). In the meantime, we have noted the bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.