Pennebaker / craftcms-thearchitect

CraftCMS plugin to generate content models from JSON data.
MIT License
171 stars 9 forks source link

I think Relabel may not be supported on Neo blocks that aren't top-level accessible #54

Open Emkaytoo opened 7 years ago

Emkaytoo commented 7 years ago

Weird issue:

  1. Neo field had two blocks: Top and Child.
  2. Both blocks had fields using Relabel.
  3. Top imported fields to block and relabeled properly.
  4. Child did not import fields to block, and thus didn't have anything to relabel.

Either the Child type is throwing an issue, or the null (code below) is causing an issue.


    {
      "group": "Page Content",
      "name": "Column Builder",
      "handle": "columnBuilder",
      "instructions": "Build out a three-column layout using this field.",
      "required": false,
      "type": "Neo",
      "typesettings": {
        "maxBlocks": "4",
        "groups": {
          "name": [],
          "sortOrder": []
        },
        "blockTypes": {
          "new0": {
            "sortOrder": "1",
            "name": "Section",
            "handle": "builderSection",
            "maxBlocks": "1",
            "childBlocks": [
              "column"
            ],
            "maxChildBlocks": null,
            "topLevel": "1",
            "fieldLayout": {
              "Content": [
                "featuredImage"
              ]
            },
            "relabel": [
              {
                "field": "featuredImage",
                "name": "Background Image",
                "instructions": "The background for this section. The photo will be behind every column in this section."
              }
            ]
          },
          "new1": {
            "sortOrder": "2",
            "name": "Column",
            "handle": "column",
            "maxBlocks": "3",
            "childBlocks": "",
            "maxChildBlocks": null,
            "topLevel": "0",
            "fieldLayout": {
              "Content": [
                "columnHeadline",
                "copy",
                "blockButton"
              ]
            },
            "relabel": [
              {
                "field": "columnHeadline",
                "name": "Headline",
                "instructions": "Use the Bold function to change the text from black to blue."
              },
              {
                "field": "blockButton",
                "name": "Button",
                "instructions": null
              }
            ]
          }
        }
      }
    },
Emkaytoo commented 7 years ago

Update: I filled in the null value and reimported this Neo field. The error still occurred.