Matrix blocks with data in native fields only won't import
Description
I have some matrix blocks only contain the native title field or no fields since the content is hardcoded. If I try to import these blocks, all other blocks but these will appear in the imported entries.
If I add any custom field to a block and include it in the import, everything works fine. If all of the custom fields in a block are empty while there still is content in the title field, it won't appear.
Steps to reproduce
- Import entries that contain a matrix where some blocks only have the title field or no field.
- Only see blocks with custom fields in the imported entries.
Additional info
- Craft version: 5.8.17
- PHP version: 8.3.21
- Database driver & version: MariaDB 11.4.5
- Plugins & versions: FeedMe 6.10.1
I think this is a new issue since the entrification of matrix blocks, since they can have title fields among other things now
Hi, thanks for getting in touch! Could you please share a snippet of your feed and a screenshot of the mapping screen?
Hi! Thanks for looking at this.
Here's an example snippet of the feed where entry.content.blocks is the content field and data is the list of entries.
In this case, the StatisticsBlock will not be imported, since title is not a custom field.
{
"data": [
{
"entry": {
"title": "Example block content",
"slug": "example-block-content",
"postDate": "2023-02-18T21:13:16.000Z",
"expiryDate": null,
"authorName": "Example",
"status": "enabled"
},
"content": {
"lead": "This overview is an example",
"image": {
"caption": "",
"isDecorative": true
},
"heroHasBackground": false,
"blocks": [
{
"type": "EditorialBlock",
"text": {
"richText": "<p>Hello</p>"
}
},
{
"type": "StatisticsBlock",
"statistics": {
"title": "The important numbers"
}
},
{
"type": "EmbedBlock",
"embed": {
"title": "What's new in Craft 5.8",
"oEmbed": "https://www.youtube.com/watch?v=hfTnGS6JvTE",
"height": "971",
"scrolling": "no"
}
}
]
},
"seo": {
"isOpen": true
},
"import": {
"legacyId": "638ed72c41ea4c9f98fb539774c4df11",
"legacyType": "ContentAreaPage"
}
}
]
}
and a screenshot of the mapping
and a screenshot of the entry editor
Hi, thanks for sending this over! Unfortunately, I’m not able to reproduce this. We had an issue where nested matrix entries (blocks) were not importing if only the title was set, but that was fixed in v6.9.0.
If you could send your composer.json, composer.lock, database export and the feed file (json) to [email protected], we can try to reproduce using your full setup and dig deeper.