craftcms-thearchitect icon indicating copy to clipboard operation
craftcms-thearchitect copied to clipboard

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

Open Emkaytoo opened this issue 7 years ago • 1 comments

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 avatar Sep 11 '17 18:09 Emkaytoo

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

Emkaytoo avatar Sep 11 '17 19:09 Emkaytoo