verbb / field-manager

Field Manager is a Craft CMS plugin to make it easy to manage your fields and field groups.
MIT License
199 stars 16 forks source link

Import failing with Neo field #82

Closed tekstrand closed 1 year ago

tekstrand commented 2 years ago

Description Export was resolved by https://github.com/verbb/field-manager/issues/79 but the import fails with Argument 1 passed to craft\models\FieldLayout::createFromConfig() must be of the type array, null given, called in <project-location>/vendor/verbb/field-manager/src/services/Service.php on line 262

Steps to reproduce

  1. Export the Neo field
  2. Try importing the json

Additional info

Additional context

engram-design commented 2 years ago

Are you able to shoot me through your export? It'll also need to include any of the fields in your blocks.

Exporting/importing a bunch of fields on my end works as expected (Neo 2.12.3)

tekstrand commented 2 years ago

Yes/no. I can get you an export of them all but we have custom field types in there that you'd need our plugins for. Let me try to replicate this on a simpler neo field that I can share more easily.

tjanpool commented 2 years ago

Hello, is this problem solved? Or are we missing an example to test it with. I myself am now also encountering this issue.

First the bigger picture: Lets stay we have a Neo element which allows us to add content blocks dynamically like, text, heading, images, videos, some carousels and also buttons with a color option. The button however is an element we like to use at multiple places, so made it into a matrix.

So my exported test case are these buttons. (I removed the text blox etc.) So we have at first level of our neo element buttons, and as second level element a wrapper of the matrix button so we could add also the color option (other usages of the button has fixed color, and I scrapped the color dropdown to make json smaller, sorry, CMS main language is Dutch). Am using:

"spicyweb/craft-neo": "2.13.5", "verbb/field-manager": "dev-craft-3 as 2.2.4", "Craft version": "3.7.28"

export code: [ { "name": "Content blokken test", "handle": "contentBlokkenTest", "instructions": "", "required": null, "searchable": false, "translationMethod": "site", "translationKeyFormat": null, "type": "benf\\neo\\Field", "settings": { "minBlocks": "", "maxBlocks": "", "maxTopBlocks": "", "maxLevels": "", "wasModified": false, "propagationMethod": "all", "propagationKeyFormat": null, "groups": [ { "name": "Layout elementen", "sortOrder": 1 } ], "blockTypes": { "new1": { "name": "Knoppen", "handle": "buttons", "sortOrder": 2, "maxBlocks": 0, "maxSiblingBlocks": 0, "maxChildBlocks": 0, "childBlocks": [ "button" ], "topLevel": true, "fieldLayout": null }, "new2": { "name": "Knop", "handle": "button", "sortOrder": 3, "maxBlocks": 0, "maxSiblingBlocks": 0, "maxChildBlocks": 0, "childBlocks": null, "topLevel": false, "fieldLayout": { "tabs": [ { "name": "Content", "sortOrder": 1, "elements": [ { "type": "craft\\fieldlayoutelements\\CustomField", "width": 100, "label": null, "instructions": null, "tip": null, "warning": null, "required": false, "fieldUid": "c0242c86-33c3-4939-b8f3-24651f75a2ea" } ] } ] } } } } }, { "name": "Knop test", "handle": "knopTest", "instructions": "", "required": null, "searchable": false, "translationMethod": "site", "translationKeyFormat": null, "type": "craft\\fields\\Matrix", "settings": { "minBlocks": "", "maxBlocks": 1, "contentTable": "{{%matrixcontent_knoptest}}", "propagationMethod": "all", "propagationKeyFormat": null, "blockTypes": { "new1": { "name": "Interne pagina", "handle": "internalPage", "fields": { "new1": { "name": "Tekst in knop", "handle": "buttonText", "required": true, "instructions": "", "searchable": false, "translationMethod": "none", "translationKeyFormat": null, "type": "craft\\fields\\PlainText", "typesettings": { "uiMode": "normal", "placeholder": null, "code": "", "multiline": "", "initialRows": 4, "charLimit": null, "byteLimit": null, "columnType": null }, "width": 100 }, "new2": { "name": "Interne Pagina", "handle": "internalPage", "required": true, "instructions": "", "searchable": false, "translationMethod": "site", "translationKeyFormat": null, "type": "craft\\fields\\Entries", "typesettings": { "sources": "*", "source": null, "targetSiteId": null, "viewMode": null, "limit": 1, "selectionLabel": "", "showSiteMenu": true, "localizeRelations": false, "validateRelatedElements": false, "allowSelfRelations": false }, "width": 100 } } }, "new2": { "name": "Externe url", "handle": "externalUrl", "fields": { "new1": { "name": "Tekst in knop", "handle": "buttonText", "required": true, "instructions": "", "searchable": false, "translationMethod": "none", "translationKeyFormat": null, "type": "craft\\fields\\PlainText", "typesettings": { "uiMode": "normal", "placeholder": null, "code": "", "multiline": "", "initialRows": 4, "charLimit": null, "byteLimit": null, "columnType": null }, "width": 100 }, "new2": { "name": "Externe url", "handle": "externalUrl", "required": true, "instructions": "", "searchable": false, "translationMethod": "none", "translationKeyFormat": null, "type": "craft\\fields\\PlainText", "typesettings": { "uiMode": "normal", "placeholder": null, "code": "", "multiline": "", "initialRows": 4, "charLimit": null, "byteLimit": null, "columnType": null }, "width": 100 } } }, "new3": { "name": "E-mailadres", "handle": "buttonEmail", "fields": { "new1": { "name": "E-mailadres", "handle": "buttonEmail", "required": true, "instructions": "", "searchable": false, "translationMethod": "none", "translationKeyFormat": null, "type": "craft\\fields\\Email", "typesettings": { "placeholder": "" }, "width": 100 } } } } } } ]