feed-me icon indicating copy to clipboard operation
feed-me copied to clipboard

Different Matrix Block Types are merged together

Open ivanBereznev opened this issue 3 years ago • 0 comments

Description

Let's imagine that there is a Matrix field myMatrix with two possible block types blocktypea and blocktypeb. Then, blocks for this field should be imported from a JSON source using Feed Me. (Though it does not have to be JSON, I am pretty sure that the same can be reproduced with any source) The JSON data looks like:

{
  "data": [
    {
      "title": "Entry A",
      "myMatrixDataA": [
        {
          "someBlockField": "someValue1"
        }
      ],
      "myMatrixDataB": [
        {
          "someOtherBlockField": "someValue2"
        }
      ]
    }
  ]
}

Fields from myMatrixDataA are mapped to fields of blocktypea, and ones from myMatrixDataB are mapped to blocktypeb.

I expect that import of such feed should create two different blocks in the entry, but instead it only creates the blocktypeb block.

Steps to reproduce

  1. Set up a field according to the description above.
  2. Add the field to an entry section
  3. Create a feed that imports a data source with format like the one described above.
  4. Try to import an entry

NOTE: probably https://github.com/craftcms/feed-me/issues/689 describes the same issue, but I am not sure.

Additional info

  • Craft version: 3.7
  • PHP version: 7.3
  • Database driver & version: PostgreSQL 13
  • Plugins & versions: Feed Me 4.4.1.1

ivanBereznev avatar Aug 31 '22 15:08 ivanBereznev