Pennebaker / craftcms-thearchitect

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

SuperTable subfields require "required" attribute to process properly #50

Open Emkaytoo opened 7 years ago

Emkaytoo commented 7 years ago

I used an exported SuperTable and was unable to reimport it.

Exported .json below:

{
      "group": "Content Builder Homepage",
      "name": "Card Bucket Containers",
      "handle": "cardBucketContainers",
      "instructions": "",
      "required": false,
      "type": "SuperTable",
      "typesettings": {
        "fieldLayout": "table",
        "staticField": null,
        "selectionLabel": "Add a row",
        "maxRows": 4,
        "blockTypes": {
          "new": {
            "fields": {
              "new1": {
                "name": "Card Title",
                "handle": "cardTitle",
                "instructions": null,
                "required": 0,
                "type": "RichText",
                "width": "",
                "typesettings": {
                  "configFile": "Headline.json",
                  "availableAssetSources": "*",
                  "availableTransforms": "*",
                  "cleanupHtml": 1,
                  "purifyHtml": 1,
                  "columnType": "text"
                }
              },
              "new2": {
                "name": "Card Description",
                "handle": "cardDescription",
                "instructions": null,
                "required": 0,
                "type": "RichText",
                "width": "",
                "typesettings": {
                  "configFile": "Standard.json",
                  "availableAssetSources": "*",
                  "availableTransforms": "*",
                  "cleanupHtml": 1,
                  "purifyHtml": 1,
                  "columnType": "text"
                }
              }
            }
          }
        }
      }
    }
Emkaytoo commented 7 years ago

Issue found: the subfields in the SuperTable need to have the required attribute or they will result in an undefined index error.