dgrigg / Craft-Migration-Manager

Deprecated - Migration Manager for Craft CMS
MIT License
39 stars 15 forks source link

Fatal error in asset volumes migration #4

Closed ajhaupt7 closed 6 years ago

ajhaupt7 commented 6 years ago

I successfully created a migration that contains an assets volume and a corresponding field that utilizes that assets volume, but getting a fatal error when I try to actually run the migration. This seems to be the case with any migration contains asset volumes.

Response: {"error":"An error occurred while executing the \"craft\\contentmigrations\\m180425_143332_migration_ATTORNEY_AWARDS migration: array_key_exists() expects parameter 2 to be array, null given"}

Here is the expanded JSON from the $json variable in the actual migration file:

{
  "settings": {
    "dependencies": {
      "assetVolumes": [{
        "name": "Awards",
        "handle": "awards",
        "type": "craft\\volumes\\Local",
        "sortOrder": "4",
        "typesettings": {
          "path": "@assetsBasePath/awards"
        },
        "hasUrls": 1,
        "url": "@assetsBaseUrl/awards"
      }]
    },
    "elements": {
      "fields": [{
        "group": "Attorney",
        "name": "Awards",
        "handle": "awards",
        "instructions": "",
        "translationMethod": "site",
        "translationKeyFormat": null,
        "required": null,
        "type": "craft\\\\fields\\\\Assets",
        "typesettings": {
          "useSingleFolder": "1",
          "defaultUploadLocationSource": "folder:1",
          "defaultUploadLocationSubpath": "",
          "singleUploadLocationSource": "folder:6",
          "singleUploadLocationSubpath": "",
          "restrictFiles": "1",
          "allowedKinds": ["image"],
          "sources": "*",
          "source": null,
          "targetSiteId": null,
          "viewMode": "list",
          "limit": "",
          "selectionLabel": "Add an Award",
          "localizeRelations": false
        }
      }],
      "assetVolumes": [{
        "name": "Awards",
        "handle": "awards",
        "type": "craft\\volumes\\Local",
        "sortOrder": "4",
        "typesettings": {
          "path": "@assetsBasePath/awards"
        },
        "hasUrls": 1,
        "url": "@assetsBaseUrl/awards",
        "fieldLayout": []
      }]
    }
  }
fb-derrick-grigg commented 6 years ago

Resolved in latest release.