Closed pl-mnm closed 3 years ago
This is what I'm seeing after adding new Matrix blocks with a Vizy field:
Wondering if you might be able to use Field Manager to export the Matrix field with all your Vizy fields, just so I can get your example up and running quickly? It looks as though the blocktypes for each field are missing, hence rendering the raw JSON for the block.
Here are the fields I'm using with only one matrix block type, which works fine:
[
{
"name": "Figure",
"handle": "figure",
"instructions": "",
"required": null,
"searchable": 0,
"translationMethod": "site",
"translationKeyFormat": null,
"type": "craft\\fields\\Assets",
"settings": {
"useSingleFolder": false,
"allowUploads": true,
"defaultUploadLocationSource": "volume:5b66aac6-0758-4512-b777-a5a162c3bf8e",
"defaultUploadLocationSubpath": "",
"singleUploadLocationSource": "volume:5b66aac6-0758-4512-b777-a5a162c3bf8e",
"singleUploadLocationSubpath": "",
"restrictFiles": "",
"allowedKinds": null,
"showUnpermittedVolumes": false,
"showUnpermittedFiles": false,
"previewMode": "full",
"sources": [
"volume:5b66aac6-0758-4512-b777-a5a162c3bf8e"
],
"source": null,
"targetSiteId": null,
"viewMode": "large",
"limit": 1,
"selectionLabel": "",
"showSiteMenu": true,
"localizeRelations": false,
"validateRelatedElements": false,
"allowSelfRelations": false
}
},
{
"name": "Page Builder",
"handle": "body",
"instructions": "",
"required": null,
"searchable": 0,
"translationMethod": "site",
"translationKeyFormat": null,
"type": "craft\\fields\\Matrix",
"settings": {
"minBlocks": "",
"maxBlocks": "",
"contentTable": "{{%matrixcontent_body}}",
"propagationMethod": "all",
"propagationKeyFormat": null,
"blockTypes": {
"new1": {
"name": "Body Copy",
"handle": "copy",
"fields": {
"new1": {
"name": "__blank__",
"handle": "builder",
"required": 1,
"instructions": "",
"searchable": 1,
"translationMethod": "none",
"translationKeyFormat": null,
"type": "verbb\\vizy\\fields\\VizyField",
"typesettings": {
"fieldData": [
{
"id": "group-LNCZiXmNSQ",
"name": "Images",
"blockTypes": [
{
"id": "type-SO1q2Nl7Iq",
"name": "Single Image",
"handle": "singleImage",
"icon": {
"label": "Image",
"value": "image-solid"
},
"enabled": true,
"layoutUid": "c55d2c23-f72a-4199-aa31-a418910644e6",
"layoutConfig": {
"tabs": [
{
"name": "Asset",
"sortOrder": 1,
"elements": [
{
"type": "craft\\fieldlayoutelements\\CustomField",
"label": "",
"instructions": "",
"required": 1,
"width": 100,
"fieldUid": "5506e4cd-b948-4955-88f6-f659cfac19ec"
},
{
"type": "craft\\fieldlayoutelements\\CustomField",
"required": false,
"width": 100,
"fieldUid": "5893d870-39dc-45b5-8968-d8f79b2968f9"
}
]
}
]
}
}
]
}
],
"vizyConfig": "Copy.json",
"configSelectionMode": "choose",
"manualConfig": "",
"availableVolumes": "*",
"availableTransforms": "*",
"showUnpermittedVolumes": "",
"showUnpermittedFiles": "",
"defaultTransform": "",
"trimEmptyParagraphs": 1,
"columnType": "text"
},
"width": 100
}
}
}
}
}
},
{
"name": "Rich Text Simple",
"handle": "richTextSimple",
"instructions": "",
"required": null,
"searchable": 0,
"translationMethod": "none",
"translationKeyFormat": null,
"type": "verbb\\vizy\\fields\\VizyField",
"settings": {
"fieldData": [],
"vizyConfig": "Simple.json",
"configSelectionMode": "choose",
"manualConfig": "",
"availableVolumes": "*",
"availableTransforms": "*",
"showUnpermittedVolumes": "",
"showUnpermittedFiles": "",
"defaultTransform": "",
"trimEmptyParagraphs": 1,
"columnType": "text"
}
}
]
And here it is after I added a field:
[
{
"name": "Page Builder",
"handle": "body",
"instructions": "",
"required": null,
"searchable": 0,
"translationMethod": "site",
"translationKeyFormat": null,
"type": "craft\\fields\\Matrix",
"settings": {
"minBlocks": "",
"maxBlocks": "",
"contentTable": "{{%matrixcontent_body}}",
"propagationMethod": "all",
"propagationKeyFormat": null,
"blockTypes": {
"new1": {
"name": "Body Copy",
"handle": "copy",
"fields": {
"new1": {
"name": "__blank__",
"handle": "builder",
"required": 1,
"instructions": "",
"searchable": 1,
"translationMethod": "none",
"translationKeyFormat": null,
"type": "verbb\\vizy\\fields\\VizyField",
"typesettings": {
"fieldData": [
{
"id": "group-zXIOrmsYPM",
"name": "Another Group",
"blockTypes": [
{
"id": "type-3zmMzRqFqP",
"name": "Another Field",
"handle": "anotherField",
"icon": {
"label": "Angular",
"value": "angular-brands"
},
"enabled": true,
"layoutUid": "384c29cc-d407-498f-8fed-9b6cc3d70e1f",
"layoutConfig": {
"tabs": [
{
"name": "Tab name",
"sortOrder": 1,
"elements": [
{
"type": "craft\\fieldlayoutelements\\CustomField",
"required": false,
"width": 100,
"fieldUid": "a18424a8-a802-4bd9-a2d0-617454ca0488"
}
]
}
]
}
}
]
}
],
"vizyConfig": "Copy.json",
"configSelectionMode": "choose",
"manualConfig": "",
"availableVolumes": "*",
"availableTransforms": "*",
"showUnpermittedVolumes": "",
"showUnpermittedFiles": "",
"defaultTransform": "",
"trimEmptyParagraphs": 1,
"columnType": "text"
},
"width": 100
}
}
},
"new2": {
"name": "Another Block",
"handle": "anotherBlock",
"fields": {
"new1": {
"name": "Block Title",
"handle": "blockTitle",
"required": 1,
"instructions": "",
"searchable": 1,
"translationMethod": "none",
"translationKeyFormat": null,
"type": "verbb\\vizy\\fields\\VizyField",
"typesettings": {
"fieldData": [
{
"id": "group-zXIOrmsYPM",
"name": "Another Group",
"blockTypes": [
{
"id": "type-3zmMzRqFqP",
"name": "Another Field",
"handle": "anotherField",
"icon": {
"label": "Angular",
"value": "angular-brands"
},
"enabled": true,
"layoutUid": "9dcf8c81-ed65-428c-a0d2-db4698a662af",
"layoutConfig": {
"tabs": [
{
"name": "Tab name",
"sortOrder": 1,
"elements": [
{
"type": "craft\\fieldlayoutelements\\CustomField",
"required": false,
"width": 100,
"fieldUid": "a18424a8-a802-4bd9-a2d0-617454ca0488"
}
]
}
]
}
}
]
}
],
"vizyConfig": "",
"configSelectionMode": "choose",
"manualConfig": "",
"availableVolumes": "*",
"availableTransforms": "*",
"showUnpermittedVolumes": "",
"showUnpermittedFiles": "",
"defaultTransform": "",
"trimEmptyParagraphs": 1,
"columnType": "text"
},
"width": 100
}
}
}
}
}
}
]
Thanks for this, should be fixed for the next release. To get the fix early, change your verbb/vizy
requirement in composer.json
to:
"require": {
"verbb/vizy": "dev-craft-3 as 1.0.5",
"...": "..."
}
Then run composer update
.
The issue here I believe was lack of handling when used multiple times in a Matrix field. However, what this has meant is the fields you've defined for each Vizy field's blocktype have gone. So, you'll need to re-save each Vizy field's blocktype fields again - sorry about this.
Seems to be working well, thank you much!
Fixed in 1.0.6
Description
I'm creating a matrix field where different blocks contain different Vizy fields. When I create a new Vizy field in a different block, it overwrites all the other Vizy configs in the other blocks with the new config. [Edit] It seems like creating any kind of block with a Vizy field messes the Vizy config.
The old blocks now appear as JSON only in the text editor and are no longer available as an option, and the initial fields are gone from the field layout in the field settings. [Edit] In the text editor, the blinking text cursor remains stuck at the top, I can't click anywhere else or select text.
Steps to reproduce
Additional info